Documentation
¶
Index ¶
- func InitConfiguration(configName string, configPaths []string, config interface{}) error
- type ConsulConfiguration
- type ESConfiguration
- type ETCDConfiguration
- type InfluxConfiguration
- type KafkaConfiguration
- type LevelMode
- type LoggerConfig
- type MinIOConfiguration
- type MongoDBConfiguration
- type MySQLConfiguration
- type MySQLLogMode
- type NSQConfiguration
- type PostgresConfiguration
- type RedisConfiguration
- type ServiceConfiguration
- type TDengineConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfiguration ¶
InitConfiguration ...
Types ¶
type ConsulConfiguration ¶
type ConsulConfiguration struct {
Address string
}
ConsulConfiguration ...
type ESConfiguration ¶
type ESConfiguration struct { Host string User string Password string ResponseHeaderTimeoutSeconds int }
ESConfiguration configuration for elasticsearch connection
type ETCDConfiguration ¶
type ETCDConfiguration struct { Endpoints []string DialTimeout int // sec Username string Password string }
ETCDConfiguration ...
type InfluxConfiguration ¶
type KafkaConfiguration ¶
KafkaConfiguration ...
type LevelMode ¶
type LevelMode string
LevelMode ...
type LoggerConfig ¶
type LoggerConfig struct { // log filename, **if it's not set, the log will be written to os.Stdout** Filename string // 枚举字符串 "warn" > "info" > "debug" > "trace" Level LevelMode }
LoggerConfig configuration for logger
type MinIOConfiguration ¶
type MinIOConfiguration struct { Endpoint string AccessKey string SecretKey string Token string SSL bool Region string }
MinIOConfiguration ...
type MongoDBConfiguration ¶
MongoDBConfiguration configuration for redis connection
type MySQLConfiguration ¶
type MySQLConfiguration struct { Host string Port int User string Password string DBName string LogMode MySQLLogMode Charset string }
MySQLConfiguration configuration for MySQL database connection
type MySQLLogMode ¶
type MySQLLogMode string
MySQLLogMode ...
const ( Console MySQLLogMode = "console" SlowQuery MySQLLogMode = "slow_query" None MySQLLogMode = "none" )
Console 使用 gorm 的 logger,打印漂亮的sql到控制台 SlowQuery 使用自定义 logger.Logger,记录慢查询sql到日志 None 关闭 log 功能
type PostgresConfiguration ¶
type PostgresConfiguration struct { Host string Port int User string Password string DBName string SSLMode bool TimeZone string LogMode MySQLLogMode }
PostgresConfiguration configuration for Postgres database connection
type RedisConfiguration ¶
RedisConfiguration ...
type ServiceConfiguration ¶
type ServiceConfiguration struct {
Port string
}
ServiceConfiguration configuration for service
Click to show internal directories.
Click to hide internal directories.