config

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLog

func InitLog(path string) (*log.Logger, error)

func LoadYaml

func LoadYaml(path string, v interface{}) error

Types

type EtcdConf

type EtcdConf struct {
	Addr []string `yaml:"addr"`
	TTL  int      `yaml:"ttl"`
}

func (*EtcdConf) InitEtcd added in v0.0.8

func (conf *EtcdConf) InitEtcd() (*clientv3.Client, error)

type HystrixConf added in v0.0.12

type HystrixConf struct {
	Name             string `yaml:"name"`
	RequestThreshold int    `yaml:"request_threshold"`
	MaxRequests      int    `yaml:"max_requests"`
	Timeout          int    `yaml:"timeout"`
	SleepWindow      int    `yaml:"sleep_window"`
	ErrorPercent     int    `yaml:"error_percent"`
}

type KafkaConf

type KafkaConf struct {
	Addr []string `yaml:"addr"`
}

type LogConf

type LogConf struct {
	Api   string `yaml:"api"`
	Exc   string `yaml:"exc"`
	Debug string `yaml:"debug"`
}

type MCConf

type MCConf struct {
	Addr []string `yaml:"addr"`
}

func (*MCConf) InitMC added in v0.0.8

func (conf *MCConf) InitMC() *memcache.Client

type MongoConf

type MongoConf struct {
	DBName string `yaml:"db_name"`
	Addr   string `yaml:"addr"`
	Type   string `yaml:"type"`
}

func (*MongoConf) InitMongo added in v0.0.8

func (conf *MongoConf) InitMongo() (*mongo.Client, error)

type MysqlConf

type MysqlConf struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	DB       string `yaml:"db"`
	User     string `yaml:"user"`
	Password string `yaml:"password"`
}

func (*MysqlConf) InitDB added in v0.0.8

func (conf *MysqlConf) InitDB() (sqlbuilder.Database, error)

type RedisConf

type RedisConf struct {
	Addr []string `yaml:"addr"`
	DB   int      `yaml:"db"`
	Type string   `yaml:"type"`
}

func (*RedisConf) InitRedis added in v0.0.8

func (conf *RedisConf) InitRedis() redis.Cmdable

type SvcConf

type SvcConf struct {
	Bind     string `yaml:"bind"`
	HttpBind string `yaml:"http_bind"`
	Name     string `yaml:"name"`
}

func (*SvcConf) InitSvc added in v0.0.8

func (conf *SvcConf) InitSvc() error

Jump to

Keyboard shortcuts

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