generated from pkg/go-template
37 lines
552 B
Go
37 lines
552 B
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
type config struct {
|
|
Redis string `json:"redis,omitempty"`
|
|
Es string `json:"es,omitempty"`
|
|
}
|
|
|
|
func TestGetMysql(t *testing.T) {
|
|
//获取 /config/mysql/api-zeus 的str
|
|
mysql, err := GetMysql("api-zeus")
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
fmt.Println(mysql)
|
|
}
|
|
|
|
func TestConfig(t *testing.T) {
|
|
c := new(config)
|
|
err := GetConfig("api-zeus", c)
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
}
|
|
|
|
func TestEnv(t *testing.T) {
|
|
env, err := GetEnv()
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
fmt.Println(env)
|
|
}
|