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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Default = Config{
		Etcd: config.Etcd{
			Endpoints: []string{
				"127.0.0.1:2379",
			},
		},
		MySQL: MySQL{
			DSN:     "admin:admin123@tcp(127.0.0.1:3306)/king_storage?charset=utf8mb4&parseTime=true&loc=Local",
			MinOpen: 3,
			MaxOpen: 10,
		},
		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: 5272,
		},
		Otel: config.Opentrace{
			Enable: true,
			DSN:    "otel-collector:4317",
		},
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Etcd   config.Etcd      `json:"etcd" toml:"etcd"`
	Log    config.Log       `json:"log" toml:"log"`
	MySQL  MySQL            `json:"mysql" toml:"mysql"`
	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 MySQL

type MySQL struct {
	DSN     string `json:"dsn" toml:"dsn"`
	MinOpen int    `json:"min-open" toml:"min-open"`
	MaxOpen int    `json:"max-open" toml:"max-open"`
}

Jump to

Keyboard shortcuts

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