Documentation ¶
Index ¶
- Variables
- func GenHash(str ...string) string
- func GetErrCode(err error) *int
- func GetStatusCode(err error) int
- func InitLogger(c LoggerConfig) (out *os.File, err error)
- func ParseFlags()
- type Config
- type CoreServiceConfig
- type HttpClientConfig
- type JobsConfig
- type KratosConfig
- type LogHandlerConfig
- type LoggerConfig
- type SocketConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Flags flags
View Source
var Logger *log_level.Logger
Functions ¶
func GetErrCode ¶
func GetStatusCode ¶
func InitLogger ¶
func InitLogger(c LoggerConfig) (out *os.File, err error)
func ParseFlags ¶
func ParseFlags()
Types ¶
type Config ¶
type Config struct { Logger LoggerConfig `json:"logger" env_var:"LOGGER_CONFIG"` Socket SocketConfig `json:"socket" env_var:"SOCKET_CONFIG"` Jobs JobsConfig `json:"jobs" env_var:"JOBS_CONFIG"` CoreService CoreServiceConfig `json:"core_service" env_var:"CORE_SERVICE_CONFIG"` HttpClient HttpClientConfig `json:"http_client" env_var:"HTTP_CLIENT_CONFIG"` Kratos KratosConfig `json:"kratos" env_var:"KRATOS_CONFIG"` EndpointsConfPath string `json:"endpoints_conf_path" env_var:"ENDPOINTS_CONF_PATH"` ComposeFilePath string `json:"compose_file_path" env_var:"COMPOSE_FILE_PATH"` CoreID string `json:"core_id" env_var:"CORE_ID"` ImgPurgeDelay int64 `json:"img_purge_delay" env_var:"IMG_PURGE_DELAY"` LogHandler LogHandlerConfig `json:"log_handler" env_var:"LOG_HANDLER_CONFIG"` }
type CoreServiceConfig ¶ added in v0.0.2
type CoreServiceConfig struct {
GatewaySrvName string `json:"gateway_srv_name" env_var:"CORE_GATEWAY_SRV_NAME"`
}
type HttpClientConfig ¶ added in v0.0.2
type JobsConfig ¶
type JobsConfig struct { BufferSize int `json:"buffer_size" env_var:"JOBS_BUFFER_SIZE"` MaxNumber int `json:"max_number" env_var:"JOBS_MAX_NUMBER"` CCHInterval int `json:"cch_interval" env_var:"JOBS_CCH_INTERVAL"` JHInterval int `json:"jh_interval" env_var:"JOBS_JH_INTERVAL"` PJHInterval int64 `json:"pjh_interval" env_var:"JOBS_PJH_INTERVAL"` MaxAge int64 `json:"max_age" env_var:"JOBS_MAX_AGE"` }
type KratosConfig ¶ added in v0.12.0
type KratosConfig struct { Version string `json:"version" env_var:"KRATOS_VERSION"` ConfigPath string `json:"config_path" env_var:"KRATOS_CONFIG_PATH"` SecretLength int `json:"secret_length" env_var:"KRATOS_SECRET_LENGTH"` SecretMaxAge int64 `json:"secret_max_age" env_var:"KRATOS_SECRET_MAX_AGE"` Interval int64 `json:"interval" env_var:"KRATOS_INTERVAL"` }
type LogHandlerConfig ¶ added in v0.14.1
type LoggerConfig ¶ added in v0.11.1
type LoggerConfig struct { Level level.Level `json:"level" env_var:"LOGGER_LEVEL"` Utc bool `json:"utc" env_var:"LOGGER_UTC"` Path string `json:"path" env_var:"LOGGER_PATH"` FileName string `json:"file_name" env_var:"LOGGER_FILE_NAME"` Terminal bool `json:"terminal" env_var:"LOGGER_TERMINAL"` Microseconds bool `json:"microseconds" env_var:"LOGGER_MICROSECONDS"` Prefix string `json:"prefix" env_var:"LOGGER_PREFIX"` }
Click to show internal directories.
Click to hide internal directories.