auth

package
v2.4.5 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSyslogUnavailable = apperr.New("syslog_unavailable", apperr.WithTextTranslate(translator.Translate{translator.RU: "Syslog %s недоступен: %s", translator.EN: "Syslog %s is unavailable: %s"}))
)

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	Level  int         `json:"level"`
	Syslog []CfgSyslog `json:"syslog"`
	File   CfgFile     `json:"file"`
	DB     CfgDB       `json:"db"`
}

type CfgDB

type CfgDB struct {
	Enabled bool `json:"enabled"`
}

type CfgFile

type CfgFile struct {
	Enabled    bool   `json:"enabled"`
	Path       string `json:"-"`
	MaxSizeMB  int    `json:"max_size_mb"`
	MaxBackups int    `json:"max_backups"`
	MaxAgeDays int    `json:"max_age_days"`
	Compress   bool   `json:"compress"`
}

type CfgSyslog

type CfgSyslog struct {
	Network string `json:"network"`
	Addr    string `json:"addr"`
}

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) Check

func (c *Configurator) Check(newData, lastData []byte) ([]byte, error)

func (*Configurator) Init

func (c *Configurator) Init() ([]byte, error)

func (*Configurator) Transform

func (c *Configurator) Transform(data []byte) ([]byte, error)

func (*Configurator) Unmarshal

func (c *Configurator) Unmarshal(data []byte) (any, 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"`
}

Jump to

Keyboard shortcuts

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