conf

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig(config AppConfig) error

Types

type AppConfig

type AppConfig interface {
	GetWebConfig() *WebConfig
	GetDBConfig() *DBConfig
	GetRedisConfig() *RedisConfig
	GetGrpcConfig() *GrpcConfig
	GetAppName() string
	GetSyslogAddr() string
	IsDev() bool
}

type DBConfig

type DBConfig struct {
	Host    string `yaml:"host"`
	Port    int    `yaml:"port"`
	MaxConn int    `yaml:"max_conn"`
	MaxIdle int    `yaml:"max_idle"`
	Name    string `yaml:"name"`
	User    string `yaml:"user"`
	Passwd  string `yaml:"passwd"`
}

type GrpcConfig

type GrpcConfig struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	CertFile string `yaml:"cert_file"`
}

type RedisConfig

type RedisConfig struct {
	Host     string `yaml:"host"`
	Password string `yaml:"password"`
	DB       int    `yaml:"db"`
}

type WebConfig

type WebConfig struct {
	Debug        bool   `yaml:"debug"`
	Host         string `yaml:"host"`
	Port         int    `yaml:"port"`
	Secret       string `yaml:"secret"`
	CertFile     string `yaml:"cert_file"`
	KeyFile      string `yaml:"key_file"`
	AuthSkip     string `yaml:"auth_skip"`
	AllowOrigins string `yaml:"allow_origins"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL