README
¶
Config
ConsulKV
package main
import (
"github.com/axolotlteam/thunder/config"
)
func main() {
v , err := config.ConsulKV("consulhost" , "key" , "ftype{json/yaml}")
if err != nil {
log.Fatal(err)
}
v.GetString("xxx.xxx")
x := config.Database{}
// maping to struct
err := viper.Unmarshal(&x)
}
Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConsulByClient ¶ added in v0.18.0
ConsulByClient -
Types ¶
type Database ¶
type Database struct { Host string `json:"host" yaml:"host"` User string `json:"user" yaml:"user"` Password string `json:"password" yaml:"password"` Database string `json:"database" yaml:"database"` Collection string `json:"collection" yaml:"collection"` SSL bool `json:"ssl" yaml:"ssl"` AppName string `json:"appname" yaml:"appname"` PoolSize uint64 `json:"poolsize" yaml:"poolsize"` ReplicaSet string `json:"replicaset" yaml:"replicaset"` }
Database -
Click to show internal directories.
Click to hide internal directories.