123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package apollo
- import (
- "testing"
- "time"
- )
- var config = new(Config)
- type Config struct {
- MySQL struct {
- Read struct {
- Addr string `yaml:"addr"`
- User string `yaml:"user"`
- Pass string `yaml:"pass"`
- Name string `yaml:"name"`
- } `yaml:"read"`
- Write struct {
- Addr string `yaml:"addr"`
- User string `yaml:"user"`
- Pass string `yaml:"pass"`
- Name string `yaml:"name"`
- } `yaml:"write"`
- Base struct {
- MaxOpenConn int `yaml:"maxOpenConn"`
- MaxIdleConn int `yaml:"maxIdleConn"`
- ConnMaxLifeTime time.Duration `yaml:"connMaxLifeTime"`
- } `yaml:"base"`
- } `yaml:"mysql"`
- Redis struct {
- Addr string `yaml:"addr"`
- Pass string `yaml:"pass"`
- Db int `yaml:"db"`
- MaxRetries int `yaml:"maxRetries"`
- PoolSize int `yaml:"poolSize"`
- MinIdleConns int `yaml:"minIdleConns"`
- } `yaml:"redis"`
- Mail struct {
- Host string `yaml:"host"`
- Port int `yaml:"port"`
- User string `yaml:"user"`
- Pass string `yaml:"pass"`
- To string `yaml:"to"`
- } `yaml:"mail"`
- JWT struct {
- Secret string `yaml:"secret"`
- ExpireDuration time.Duration `yaml:"expireDuration"`
- } `yaml:"jwt"`
- URLToken struct {
- Secret string `yaml:"secret"`
- ExpireDuration time.Duration `yaml:"expireDuration"`
- } `yaml:"urlToken"`
- HashIds struct {
- Secret string `yaml:"secret"`
- Length int `yaml:"length"`
- } `yaml:"hashids"`
- }
- func TestGetApolloConfig(t *testing.T) {
- GetApolloConfig("authentication-sever", "269623f320014ce393971763ef2025ed", config)
- }
|