conf

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package conf contains alias for map encoded configuration and structure unmarshaller

Index

Constants

View Source
const TagName = "cfg"

TagName is a tag name, used for decoder customization

Variables

View Source
var ErrNilConfigMap = errors.New("unable to process nil map")

ErrNilConfigMap returned if unmarshalling map is nil and could not be decoded into structure

Functions

This section is empty.

Types

type MapConfig

type MapConfig map[string]any

MapConfig is just alias for map[string]any

func (MapConfig) MarshalZerologObject

func (m MapConfig) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject writes map into zerolog event

func (MapConfig) Unmarshal

func (m MapConfig) Unmarshal(into any) (err error)

Unmarshal decodes receiver map into provided structure. Decoder configured to automatically unmarshal inherited structures, convert string-ed duration (1s, 2m, 3h...) into time.Duration and string representation IP into net.IP. Tag used for decode customization is conf.TagName.

type NamedMapConfig added in v0.0.3

type NamedMapConfig struct {
	Name   string
	Config MapConfig
}

NamedMapConfig encapsulates MapConfig with string Name

func (NamedMapConfig) MarshalZerologObject added in v0.0.3

func (nm NamedMapConfig) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject writes Name and Config into zerolog event

Jump to

Keyboard shortcuts

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