Documentation
¶
Index ¶
- Variables
- type Cfg
- type CfgDB
- type CfgFile
- type CfgSyslog
- type Configurator
- func (c *Configurator) Action() string
- func (c *Configurator) AfterUpdate(data []byte) error
- func (c *Configurator) Check(newData, lastData []byte) ([]byte, error)
- func (c *Configurator) Init() ([]byte, error)
- func (c *Configurator) Transform(data []byte) ([]byte, error)
- func (c *Configurator) Unmarshal(data []byte) (any, error)
- func (c *Configurator) Watch() <-chan Cfg
- type Request
- type Transformer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
)
Functions ¶
This section is empty.
Types ¶
type Configurator ¶
type Configurator struct {
// contains filtered or unexported fields
}
func NewConfigurator ¶
func NewConfigurator(logPath string) *Configurator
func (*Configurator) Action ¶
func (c *Configurator) Action() string
func (*Configurator) AfterUpdate ¶
func (c *Configurator) AfterUpdate(data []byte) error
func (*Configurator) Init ¶
func (c *Configurator) Init() ([]byte, error)
func (*Configurator) Watch ¶
func (c *Configurator) Watch() <-chan Cfg
type Request ¶
type Request struct {
Level int `json:"level" binding:"oneof=0 1 2 3 4 5"`
Syslog []struct {
Network string `json:"network" binding:"required,oneof=tcp udp"`
Addr string `json:"addr" binding:"required"`
} `json:"syslog" binding:"required,dive"`
File struct {
Enabled bool `json:"enabled"`
MaxSizeMB int `json:"max_size_mb" binding:"required,min=1,max=65535"`
MaxBackups int `json:"max_backups" binding:"required,min=1,max=65535"`
MaxAgeDays int `json:"max_age_days" binding:"required,min=1,max=65535"`
Compress bool `json:"compress"`
} `json:"file" binding:"required"`
DB struct {
Enabled bool `json:"enabled"`
} `json:"db" binding:"required"`
}
type Transformer ¶
type Transformer struct {
Level int `json:"level"`
Syslog []struct {
Network string `json:"network"`
Addr string `json:"addr"`
} `json:"syslog"`
File struct {
Enabled bool `json:"enabled"`
MaxSizeMB int `json:"max_size_mb"`
MaxBackups int `json:"max_backups"`
MaxAgeDays int `json:"max_age_days"`
Compress bool `json:"compress"`
} `json:"file"`
DB struct {
Enabled bool `json:"enabled"`
} `json:"db" binding:"required"`
}
Click to show internal directories.
Click to hide internal directories.