config

package
v0.0.0-...-0f17f66 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureToml

func ConfigureToml(obj interface{}, file string, must bool)

Configure .

Types

type BaseConfig

type BaseConfig struct {
	ServerId    string `json:"server_id" toml:"server_id"`
	ServerGroup string `json:"server_group" toml:"server_group"`
	ServerName  string `json:"server_name" toml:"server_name"`
	ServerType  string `json:"server_type" toml:"server_type"`
}

func (*BaseConfig) String

func (m *BaseConfig) String() string

type CacheConfig

type CacheConfig struct {
	CacheName  string
	MetaConfig map[string]interface{}
}

type DbConfig

type DbConfig struct {
	DbName     string
	MetaConfig map[string]interface{}
}

type LogConfig

type LogConfig struct {
	LogDir     string `json:"log_dir" toml:"log_dir"`
	LogLevel   string `json:"log_level" toml:"log_level"`
	StatLogDir string `json:"stat_log_dir" toml:"stat_log_dir"`
}

type MiddlewareConfig

type MiddlewareConfig struct {
	MiddlewareName string
	MetaConfig     map[string]interface{}
}

type PluginConfig

type PluginConfig struct {
	PluginName string
	MetaConfig map[string]interface{}
}

type RedisConfig

type RedisConfig struct {
	RedisAddr string `yaml:"addr"`
	RedisPwd  string `yaml:"pwd"`
}

type ServerConfig

type ServerConfig struct {
	BaseConfig *BaseConfig `json:"base_config" toml:"base_config"`
	LogConfig  *LogConfig  `json:"log_config" toml:"log_config"`
	//PluginConfig *PluginConfig `json:"plugin_config"`
	//DbConfig     *DbConfig     `json:"db_config"`
	//CacheConfig  *CacheConfig  `json:"cache_config"`
	Tracer opentracing.Tracer
}

func (*ServerConfig) GetTracer

func (m *ServerConfig) GetTracer() opentracing.Tracer

type StaticFileConfig

type StaticFileConfig interface {
	GetServer() *ServerConfig
	GetCache() *RedisConfig
}

type YamlConfig

type YamlConfig struct {
	Server *ServerConfig `yaml:"server"`
	Redis  *RedisConfig  `yaml:"redis"`
}

func (*YamlConfig) GetCache

func (m *YamlConfig) GetCache() *RedisConfig

func (*YamlConfig) GetServer

func (m *YamlConfig) GetServer() *ServerConfig

Jump to

Keyboard shortcuts

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