conf

package
v0.0.0-...-378a548 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Default = Config{
		MongoDB: MongoDB{
			DSN:      "mongodb://127.0.0.1:27017/transaction_db",
			Database: "transaction_db",
		},
		Collector: Collector{
			CodeList: []string{
				"sh688***",
				"sh605***",
				"sh603***",
				"sh601***",
				"sh600***",
				"sz300***",
				"sz0030**",
				"sz002***",
				"sz001***",
				"sz000***",
			},
			Source:       "sina",
			Crontab:      "05 18 * * MON,TUE,WED,THU,FRI",
			RandomPeriod: "20,60",
		},
		Etcd: config.Etcd{
			Endpoints: []string{
				"127.0.0.1:2379",
			},
		},
		Otel: config.Opentrace{
			Enable: true,
			DSN:    "otel-collector:4317",
		},
		Log: config.Log{
			DisableTimestamp: false,
			Level:            "info",
			Format:           "json",
			MaxSize:          100,
			MaxDays:          180,
			MaxBackups:       90,
			Compress:         true,
		},
		Server: config.Server{
			Host: "0.0.0.0",
			Port: 5271,
		},
	}
)

Functions

This section is empty.

Types

type Collector

type Collector struct {
	CodeList     []string `json:"code-list" toml:"code-list"`
	Source       string   `json:"source" toml:"source"`
	Crontab      string   `json:"crontab" toml:"crontab"`
	RandomPeriod string   `json:"random-period" toml:"random-period"`
}

type Config

type Config struct {
	Collector Collector `json:"collector" toml:"collector"`
	MongoDB   MongoDB   `json:"mongodb" toml:"mongodb"`

	Etcd   config.Etcd      `json:"etcd" toml:"etcd"`
	Log    config.Log       `json:"log" toml:"log"`
	Server config.Server    `json:"server" toml:"server"`
	Otel   config.Opentrace `json:"otel" toml:"otel"`
}

func (*Config) LoadFile

func (c *Config) LoadFile(path string) error

func (*Config) String

func (c *Config) String() string

type MongoDB

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

Jump to

Keyboard shortcuts

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