cfg

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfiguration

func InitConfiguration(configName string, configPaths []string, config interface{}) error

InitConfiguration ...

Types

type CreeperConfiguration added in v0.0.2

type CreeperConfiguration struct {
	Uri   string
	Token string
}

CreeperConfiguration ...

type ESConfiguration

type ESConfiguration struct {
	Host                         string
	User                         string
	Password                     string
	ResponseHeaderTimeoutSeconds int
}

ESConfiguration configuration for elasticsearch connection

type InfluxConfiguration

type InfluxConfiguration struct {
	Host  string
	Port  string
	Token string
}

type KafkaConfiguration

type KafkaConfiguration struct {
	Brokers    []string
	User       string
	Password   string
	EnableSASL bool
}

KafkaConfiguration ...

type LevelMode

type LevelMode string

LevelMode ...

const (
	LevelWarn  LevelMode = "warn"
	LevelInfo  LevelMode = "info"
	LevelDebug LevelMode = "debug"
	LevelTrace LevelMode = "trace"
)

LevelMode ... warn > info > debug > trace

func (LevelMode) IsDebugMode

func (l LevelMode) IsDebugMode() bool

IsDebugMode ...

func (LevelMode) Level

func (l LevelMode) Level() logrus.Level

Level ...

type LoggerConfig

type LoggerConfig struct {
	// log filename, **if it's not set, the log will be written to os.Stdout**
	Filename string
	// maximun size of single file, unit: MB
	MaxSize int
	// maximun number of days to retain the log file, unit: day
	MaxAge int
	// maximum number of log files to retain
	MaxBackups int
	// whether compress log file
	Compress bool
	// 枚举字符串 "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

type MongoDBConfiguration struct {
	Host   string
	DBName string
}

MongoDBConfiguration configuration for redis connection

type MySQLConfiguration

type MySQLConfiguration struct {
	Host     string
	Port     string
	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     string
	User     string
	Password string
	DBName   string
	LogMode  MySQLLogMode
}

PostgresConfiguration configuration for Postgres database connection

type RedisConfiguration

type RedisConfiguration struct {
	Host string
	Port string
}

RedisConfiguration ...

type RemoteServiceConfiguration

type RemoteServiceConfiguration struct {
	// eg: "180.96.8.140:9998"
	RemoteHost string
	// eg: "/gateway/twirp/rime.adam.rpc_gateway.RPCGateway/"
	RemotePathPrefix string
}

RemoteServiceConfiguration ...

type ServiceConfiguration

type ServiceConfiguration struct {
	Port string
}

ServiceConfiguration configuration for service

type WarehouseConfiguration added in v0.0.2

type WarehouseConfiguration struct {
	Uri       string
	AccessKey string
	SecretKey string
	Timeout   time.Duration
}

WarehouseConfiguration ...

Jump to

Keyboard shortcuts

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