conf

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT Imports: 3 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 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 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
	// 枚举字符串 "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     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 NSQConfiguration

type NSQConfiguration struct {
	Address []string
}

NSQConfiguration ...

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

type RedisConfiguration struct {
	Addr     string
	Db       int
	Password string
}

RedisConfiguration ...

type ServiceConfiguration

type ServiceConfiguration struct {
	Port string
}

ServiceConfiguration configuration for service

type TDengineConfiguration

type TDengineConfiguration struct {
}

TDengineConfiguration ...

Jump to

Keyboard shortcuts

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