Documentation ¶
Index ¶
- func InitConfiguration(configName string, configPaths []string, config interface{}) error
- type LoggerConfig
- type MetricsConfig
- type MySQLConfiguration
- type MySQLLogMode
- type OpenTelemetryConfig
- type OpenTelemetryLogsConfig
- type OpenTelemetryTracesConfig
- type PostgresConfiguration
- type RedisConfiguration
- type ServiceConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfiguration ¶
InitConfiguration initializes the configuration by first attempting to read from environment variables, and then falling back to configuration files if the environment variables are not set.
Types ¶
type LoggerConfig ¶
LoggerConfig configuration for logger
type MetricsConfig ¶
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 关闭 logs 功能
type OpenTelemetryConfig ¶
type OpenTelemetryConfig struct { Traces OpenTelemetryTracesConfig Logs OpenTelemetryLogsConfig }
type OpenTelemetryLogsConfig ¶
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 ¶
ServiceConfiguration configuration for service
Click to show internal directories.
Click to hide internal directories.