Documentation ¶
Index ¶
Constants ¶
View Source
const ( // default values by convention DefaultType = "json" DefaultFile = "config" // environment variables EnvConsulHostKey = "GOCONF_CONSUL" EnvTypeKey = "GOCONF_TYPE" EnvFileNameKey = "GOCONF_FILENAME" EnvPrefixKey = "GOCONF_ENV_PREFIX" SourceEnv Source = "env" SourceFile Source = "file" SourceConsul Source = "consul" )
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func LoadConfig(cfgFile string)
Types ¶
type Config ¶
type Config struct { Rest struct { Port int `mapstructure:"port"` BodyLimit int `mapstructure:"body_limit"` ReduceMemoryUsage bool `mapstructure:"reduce_memory_usage"` ReadTimeOut int `mapstructure:"read_timeout"` WriteTimeOut int `mapstructure:"write_timeout"` } `mapstructure:"rest"` Logger struct { Level string `mapstructure:"level"` } `mapstructure:"logger"` Database struct { Postgres struct { Host string `mapstructure:"host"` Port int `mapstructure:"port"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` Database string `mapstructure:"database"` } `mapstructure:"postgresdb"` Maria struct { Dsn string `mapstructure:"dsn"` } `mapstructure:"mariadb"` Mongo struct { URI string `mapstructure:"uri"` Db string `mapstructure:"db"` ConnectionTimeOut int64 `mapstructure:"connection_timeout"` PingTimeOut int64 `mapstructure:"ping_timeout"` } `mapstructure:"mongodb"` } `mapstructure:"database"` TracerConfig TracerConfig `mapstructure:"tracer_config"` }
var (
GlobalCfg Config
)
type TracerConfig ¶
type TracerConfig struct { Tracer string `mapstructure:"tracer" json:"tracer"` JaegerCollectorURL string `mapstructure:"jaeger_url" json:"jaeger_url"` JaegerMode string `mapstructure:"jaeger_mode" json:"jaeger_mode"` SamplingRate float32 `mapstructure:"tracer_sample_rate" json:"tracer_sample_rate"` }
Click to show internal directories.
Click to hide internal directories.