conf

package
v0.0.0-...-d2b7790 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultGlobal = &Config{
	Server: Server{
		GrpcHost: "0.0.0.0",
		GrpcPort: 10130,
	},
	Log: Log{
		DisableTimestamp: false,
		Level:            "info",
		Format:           "text",
		MaxSize:          30,
		MaxDays:          180,
		Dir:              "../log",
		Compress:         true,
	},
}

Functions

func SetupLogger

func SetupLogger(l Log) ([]func() error, error)

Types

type Config

type Config struct {
	Server Server `json:"server" toml:"server"`
	Log    Log    `json:"log" toml:"log"`
}

func (*Config) ParseFile

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

func (*Config) String

func (c *Config) String() string

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"`
	MaxSize          int    `json:"maxsize" toml:"maxsize"`
	MaxDays          int    `toml:"max-days" json:"max-days"`
	Dir              string `toml:"dir" json:"dir"`
	Compress         bool   `toml:"compress" json:"compress"`
}

type Server

type Server struct {
	GrpcHost string `json:"grpc-host" toml:"grpc-host"`
	GrpcPort int    `json:"grpc-port" toml:"grpc-port"`
}

Jump to

Keyboard shortcuts

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