config

package
v0.0.0-...-45d551c Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalConfig = &Config{
	Log: Log{
		DisableTimestamp: false,
		Level:            "info",
		Format:           "text",
		FileName:         "/tmp/robber-datasource/data.log",
		MaxSize:          20,
	},
	MongoDB: MongoDB{
		DSN: "mongodb://127.0.0.1:27017",
	},
	Etcd: Etcd{
		Endpoints: []string{
			"127.0.0.1:2379",
		},
	},
	Server: Server{
		Host: "0.0.0.0",
		Port: 27320,
	},
	Collect: Collect{
		CodeList: []string{
			"sh688***",
			"sh605***",
			"sh603***",
			"sh601***",
			"sh600***",
			"sz300***",
			"sz0030**",
			"sz002***",
			"sz001**",
			"sz000***",
		},
	},
}

Functions

This section is empty.

Types

type Collect

type Collect struct {
	CodeList []string `json:"code-list" toml:"code-list"`
}

type Config

type Config struct {
	Log     Log     `json:"log" toml:"log"`
	MongoDB MongoDB `json:"mongodb" toml:"mongodb"`
	Etcd    Etcd    `json:"etcd" toml:"etcd"`
	Server  Server  `json:"server" toml:"server"`
	Collect Collect `json:"collect" toml:"collect"`
}

func (*Config) Load

func (c *Config) Load(path string, override func(cfg *Config)) error

func (*Config) String

func (cg *Config) String() string

type Etcd

type Etcd struct {
	Endpoints []string `json:"endpoints" toml:"endpoints"`
}

type Log

type Log struct {
	DisableTimestamp bool   `json:"disable-timestamp" toml:"disable-timestamp"`
	Level            string `json:"level" toml:"level"`
	Format           string `json:"format" toml:"format"`
	FileName         string `json:"filename" toml:"filename"`
	MaxSize          int    `json:"maxsize" toml:"maxsize"`
}

type MongoDB

type MongoDB struct {
	DSN string `json:"dsn" toml:"dsn"`
}

type Server

type Server struct {
	Host string `json:"host" toml:"host"`
	Port int    `json:"port" toml:"port"`
}

Jump to

Keyboard shortcuts

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