cfg

package
v0.0.0-...-52fa7fc Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: GPL-3.0 Imports: 13 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

SetConfigCtx saves config object to context

Types

type Config

type Config struct {
	Listener   listener.Config   `json:"listener" validate:"required"`
	Operator   operator.Config   `json:"operator" validate:"required"`
	Management management.Config `json:"management" validate:"required"`
	Db         db.Config         `json:"db" validate:"required"`
	Pki        pki.Config        `json:"pki"`
}

Config holds all config file entries

func GetConfigCtx

func GetConfigCtx(ctx context.Context) Config

GetConfigCtx gathers config object from context

func Read

func Read(path string) (Config, error)

Read gets content of file by path and maps it on config structure

func (Config) Validate

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

Validate checks fileds in config structure

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳