Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcessorAPI    = "api"
	ProcessorScript = "script"
)

Variables

This section is empty.

Functions

func ConfigureLogger

func ConfigureLogger(conf *Configuration) *logger.Logger

func LoadConfig

func LoadConfig(path string, Config *Configuration) error

Types

type Configuration

type Configuration struct {
	Logger struct {
		Console struct {
			PrintFile   bool `yaml:"print_file"`
			EnableColor bool `yaml:"enable_color"`
			LogLevel    int  `yaml:"log_level"`
			Enabled     bool `yaml:"enabled"`
		} `yaml:"console"`
	} `yaml:"logger"`
	Prometheus struct {
		Enabled                 bool              `yaml:"enabled"`
		Port                    int               `yaml:"port"`
		Path                    string            `yaml:"path"`
		RecalcEstabConnsTimeout time.Duration     `yaml:"recalc_estab_timeout"`
		LiveRecalc              bool              `yaml:"live_recalc"`
		Labels                  map[string]string `yaml:"static_labels"`
		Detailed                bool              `yaml:"detailed"`
	} `yaml:"prometheus"`
	Radius struct {
		ListenAddr string `yaml:"listen_addr"`
		Secret     string `yaml:"secret"`
		// ReadBufferSize - размер SO_RCVBUF в байтах. 0 - системный default
		// (обычно net.core.rmem_default, на busy-системах маловат под всплески).
		ReadBufferSize int `yaml:"read_buffer_size"`
	} `yaml:"radius"`

	// processor: "api" (по умолчанию) или "script" - выбирает, какой из блоков ниже используется
	Processor string        `yaml:"processor"`
	Api       api.ApiConfig `yaml:"api"`
	Script    script.Config `yaml:"script"`

	Profiler struct {
		Port    int  `yaml:"port"`
		Enabled bool `yaml:"enabled"`
	} `yaml:"profiler"`
}

Jump to

Keyboard shortcuts

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