Documentation ¶
Index ¶
- Constants
- Variables
- func NewConfig(conf interface{}, configType string)
- func NewConfigJson(conf interface{})
- func NewConfigToml(conf interface{})
- func NewConfigYaml(conf interface{})
- func NewConfigYml(conf interface{})
- type ClickHouseCnfDto
- type FacebookOAuthCnfDto
- type GoogleOAuthCnfDto
- type GrpcCnfDto
- type HttpCnfDto
- type KafkaCnfDto
- type LogCnfDto
- type MysqlCnfDto
- type NacosCnfDto
- type PostgreSqlCnfDto
- type PostgreSqlPoolCnfDto
- type RabbitMQCnfDto
- type RedisCnfDto
- type RedisPoolCnfDto
- type TarantoolCnfDto
Constants ¶
View Source
const ( CONFIG_TYPE_YAML = "yaml" CONFIG_TYPE_YML = "yml" CONFIG_TYPE_JSON = "json" CONFIG_TYPE_TOML = "toml" )
View Source
const CONFIG_DIR = "config"
View Source
const SETTINGS_NAME = "settings"
Variables ¶
View Source
var ClickHouseCnf = ClickHouseCnfDto{ Host: "127.0.0.1", Port: 9000, Pwd: "", DbName: "", Debug: true, }
View Source
var KafkaCnf = KafkaCnfDto{ Host: "127.0.0.1", Port: 9092, Debug: true, }
View Source
var PostgreSqlCnf = PostgreSqlCnfDto{ Host: "127.0.0.1", Port: 5432, User: "postgres", Pwd: "", DbName: "postgres", Debug: true, MaxConn: 10, }
View Source
var PostgreSqlPoolCnf = PostgreSqlPoolCnfDto{
MaxConn: 10,
}
View Source
var RabbitMQCnf = RabbitMQCnfDto{ Host: "127.0.0.1", Port: 5672, User: "", Pwd: "", Vhost: "", Debug: true, }
View Source
var RedisCnf = RedisCnfDto{ Host: "127.0.0.1", Port: 6379, Pwd: "", DB: 0, Debug: true, }
View Source
var RedisPoolCnf = RedisPoolCnfDto{
PoolSize: 4,
MinIdleConns: 10,
DialTimeout: 5,
ReadTimeout: 3,
WriteTimeout: 3,
PoolTimeout: 4,
IdleCheckFrequency: 60,
IdleTimeout: 5,
MaxConnAge: 0,
MaxRetries: 0,
MinRetryBackoff: 8,
MaxRetryBackoff: 512,
Timeout: 5,
KeepAlive: 5,
}
View Source
var TarantoolCnf = TarantoolCnfDto{ Host: "127.0.0.1", Port: 3301, Pwd: "", User: "", Debug: true, }
Functions ¶
func NewConfigJson ¶ added in v0.0.2
func NewConfigJson(conf interface{})
func NewConfigToml ¶ added in v0.0.2
func NewConfigToml(conf interface{})
func NewConfigYaml ¶ added in v0.0.2
func NewConfigYaml(conf interface{})
func NewConfigYml ¶ added in v0.0.2
func NewConfigYml(conf interface{})
Types ¶
type ClickHouseCnfDto ¶
type FacebookOAuthCnfDto ¶
type GoogleOAuthCnfDto ¶
type GrpcCnfDto ¶
type HttpCnfDto ¶
type KafkaCnfDto ¶
type MysqlCnfDto ¶
type NacosCnfDto ¶
type PostgreSqlCnfDto ¶
type PostgreSqlPoolCnfDto ¶
type PostgreSqlPoolCnfDto struct {
MaxConn int // 最大连接
}
type RabbitMQCnfDto ¶
type RedisCnfDto ¶
type RedisPoolCnfDto ¶
type RedisPoolCnfDto struct { PoolSize int // 连接池最大socket连接数,默认为4倍CPU数, 4 * runtime.NumCPU MinIdleConns int // 在启动阶段创建指定数量的Idle连接,并长期维持idle状态的连接数不少于指定数量;。 DialTimeout int // 连接建立超时时间,默认5秒。 ReadTimeout int // 读超时,默认3秒, -1表示取消读超时 WriteTimeout int // 写超时,默认等于读超时 PoolTimeout int // 当所有连接都处在繁忙状态时,客户端等待可用连接的最大等待时长,默认为读超时+1秒。 IdleCheckFrequency int // 闲置连接检查的周期,默认为1分钟,-1表示不做周期性检查,只在客户端获取连接时对闲置连接进行处理。 IdleTimeout int // 闲置超时,默认5分钟,-1表示取消闲置超时检查 MaxConnAge int // 连接存活时长,从创建开始计时,超过指定时长则关闭连接,默认为0,即不关闭存活时长较长的连接 MaxRetries int // 命令执行失败时,最多重试多少次,默认为0即不重试 MinRetryBackoff int // 每次计算重试间隔时间的下限,默认8毫秒,-1表示取消间隔 MaxRetryBackoff int // 每次计算重试间隔时间的上限,默认512毫秒,-1表示取消间隔 Timeout int // KeepAlive int // }
Source Files ¶
- config_env.go
- config_file.go
- config_new.go
- dto_clickhouse.go
- dto_elasticsearch.go
- dto_etcd.go
- dto_grpc.go
- dto_http.go
- dto_kafka.go
- dto_log.go
- dto_mongodb.go
- dto_mysql.go
- dto_nacos.go
- dto_oauth_facebook.go
- dto_oauth_google.go
- dto_postgresql.go
- dto_postgresql_pool.go
- dto_rabbitmq.go
- dto_redis.go
- dto_redis_pool.go
- dto_tarantool.go
Click to show internal directories.
Click to hide internal directories.