Documentation
¶
Index ¶
- Variables
- func InitConf(path string)
- func InitConfIni(path string)
- func NewConf(appConfigPath string) error
- func YamlGet(key string) (interface{}, bool)
- func YamlGetInt64(key string) (int64, error)
- func YamlGetString(key string) (string, error)
- type App
- type Cluster
- type ConfigType
- type Configs
- type DefaultConf
- type GrpcClient
- type GrpcServer
- type HttpServer
- type Jwt
- type Kafka
- type LogCentre
- type Minio
- type Mongo
- type MqType
- type Mysql
- type Nsq
- type Rabbit
- type Redis
- type TcpClient
- type TcpServer
- type UdpClient
- type UdpServer
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = &conf{}
Functions ¶
func YamlGetInt64 ¶
Types ¶
type Cluster ¶
type Cluster struct {
Open bool `yaml:"open"`
MyAddr string `yaml:"myAddr"`
InitCluster string `yaml:"initCluster"`
}
Cluster 集群使用 主要用于 ServiceTable
type Configs ¶
type Configs struct {
YamlPath string
YamlData map[string]interface{}
Default *DefaultConf
}
type DefaultConf ¶
type DefaultConf struct {
App *App `yaml:"app"`
HttpServer *HttpServer `yaml:"httpServer"`
GrpcServer *GrpcServer `yaml:"grpcServer"`
GrpcClient *GrpcClient `yaml:"grpcClient"`
TcpServer *TcpServer `yaml:"tcpServer"`
TcpClient *TcpClient `yaml:"tcpClient"`
UdpServer *UdpServer `yaml:"udpServer"`
UdpClient *UdpClient `yaml:"udpClient"`
Redis []*Redis `yaml:"redis"`
Mysql []*Mysql `yaml:"mysql"`
MqType string `yaml:"mqType"`
Nsq *Nsq `yaml:"nsq"`
Rabbit *Rabbit `yaml:"rabbit"`
Kafka *Kafka `yaml:"kafka"`
Mongo []*Mongo `yaml:"mongo"`
TTF string `yaml:"ttf"`
Cluster *Cluster `yaml:"cluster"`
LogCentre *LogCentre `yaml:"logCentre"`
Jwt *Jwt `yaml:"jwt"`
Minio *Minio `yaml:"minio"`
Mq string `yaml:"mq"`
User []*User `yaml:"user"`
}
type GrpcServer ¶
GrpcServer grpc服务
type HttpServer ¶
HttpServer http服务
type Minio ¶
type Minio struct {
Host string `yaml:"host"`
Access string `yaml:"access"`
Secret string `yaml:"secret"`
}
Minio 对象存储 minio配置
type Mongo ¶
type Mongo struct {
Host string `yaml:"host"`
User string `yaml:"user"`
Password string `yaml:"password"`
}
Mongo mongo配置
type Mysql ¶
type Mysql struct {
DBName string `yaml:"dbname"`
User string `yaml:"user"`
Password string `yaml:"password"`
Host string `yaml:"host"`
Port string `yaml:"port"`
}
Mysql mysql配置
type Rabbit ¶
type Rabbit struct {
Addr string `yaml:"addr"`
User string `yaml:"user"`
Password string `yaml:"password"`
}
Rabbit 消息队列rabbit配置
type Redis ¶
type Redis struct {
Name string `yaml:"name"` // 自定义一个昵称
Host string `yaml:"host"`
Port string `yaml:"port"`
DB string `yaml:"db"`
Password string `yaml:"password"`
MaxIdle int `yaml:"maxIdle"`
MaxActive int `yaml:"maxActive"`
}
Redis redis配置
Click to show internal directories.
Click to hide internal directories.