config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendConfig

type BackendConfig struct {
	PdAddr string `toml:"pd-address"`
}

BackendConfig pd config

type Config

type Config struct {
	Appname  string                  `toml:"appname"`
	Host     string                  `toml:"host"`
	Port     uint                    `toml:"port"`
	MaxConn  uint                    `toml:"max_connection"`
	Auth     string                  `toml:"auth"`
	Backend  BackendConfig           `toml:"backend"`
	Log      LogConfig               `toml:"log"`
	Metric   metricutil.MetricConfig `toml:"metric"`
	RunExpGc bool
}

Config file

func NewConfig

func NewConfig() *Config

NewConfig init config

func (*Config) LoadConfig

func (c *Config) LoadConfig(path string) (*Config, error)

LoadConfig load config file from path

func (*Config) ToLogConfig

func (c *Config) ToLogConfig() *logutil.LogConfig

ToLogConfig to log config

type LogConfig

type LogConfig struct {
	Level   string `toml:"level"`
	Format  string `toml:"format"`
	LogPath string `toml:"log-path"`
	MaxSize uint   `toml:"max-size"`
	MaxDays uint   `toml:"max-days"`
}

LogConfig log config file

Jump to

Keyboard shortcuts

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