package
Version:
v0.2.2
Opens a new window with list of versions in this module.
Published: Sep 22, 2019
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
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
¶
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"`
}
Database -
type Logger struct {
Level string `json:"level" yaml:"level"`
Webhook string `json:"webhook" yaml:"webhook"`
}
Logger -
Source Files
¶
Click to show internal directories.
Click to hide internal directories.