config

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig = NewConfig("")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	LogConf *LogConfig
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(configPath string) *Config

func (*Config) Init

func (c *Config) Init() error

type HandlerConfig

type HandlerConfig struct {
	Type     string          `yaml:"type"`
	Marker   string          `yaml:"marker"`
	Levels   []string        `yaml:"levels"`
	File     string          `yaml:"file"`
	Rollover *RolloverConfig `yaml:"rollover"`
	Sync     *SyncConfig     `yaml:"sync"`
	Message  *MessageConfig  `yaml:"message"`
}

func NewHandlerConfig

func NewHandlerConfig() *HandlerConfig

type LogConfig

type LogConfig struct {
	Handlers []HandlerConfig `yaml:"handlers"`
	Level    string          `yaml:"level"`
}

func NewLogConfig

func NewLogConfig() *LogConfig

type MessageConfig

type MessageConfig struct {
	Format string `yaml:"format"`
}

func NewMessageConfig

func NewMessageConfig() *MessageConfig

type RolloverConfig

type RolloverConfig struct {
	RolloverInterval string `yaml:"rollover_interval"`
	RolloverSize     string `yaml:"rollover_size"`
	BackupCount      int    `yaml:"backup_count"`
	BackupTime       string `yaml:"backup_time"`
}

func NewRolloverConfig

func NewRolloverConfig() *RolloverConfig

type SyncConfig

type SyncConfig struct {
	AsyncWrite    bool `yaml:"async_write"`
	FlushInterval int  `yaml:"flush_interval"`
	FlushSize     int  `yaml:"flush_size"`
	QueueSize     int  `yaml:"queue_size"`
}

func NewSyncConfig

func NewSyncConfig() *SyncConfig

Jump to

Keyboard shortcuts

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