cfg

package
v0.0.0-...-2b4f063 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfigCtx

func SetConfigCtx(ctx context.Context, c Config) context.Context

Добавление в контекст конфиг

Types

type Config

type Config struct {
	Debug      bool                `json:"debug" validate:"omitempty"`
	Listener   listener.ConfigV1   `json:"listener" validate:"required"`
	Operator   operator.ConfigV1   `json:"operator" validate:"required"`
	Management management.ConfigV1 `json:"management" validate:"required"`
	Db         db.ConfigV1         `json:"db" validate:"required,one_of_nested"`
	Pki        pki.ConfigV1        `json:"pki"`
	Webhook    webhook.Config      `json:"webhook"`
}

Структура конфигурационного файла

func GetConfigCtx

func GetConfigCtx(ctx context.Context) Config

Получение конфига из контекста

func Read

func Read(path string) (Config, error)

Вычитывание конфиг файла и маппинг полей

func (Config) Validate

func (c Config) Validate(ctx context.Context) error

Валидация полей структуры из конфига

Jump to

Keyboard shortcuts

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