plugconf

package
v0.0.0-...-f22496c Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TagName            = "plugconf"
	ErrOutputNotStruct = errors.New("output is not a struct")
)

Functions

This section is empty.

Types

type ErrAlreadyRegistered

type ErrAlreadyRegistered struct {
	// contains filtered or unexported fields
}

func NewErrAlreadyRegistered

func NewErrAlreadyRegistered(field string, reg *registration) *ErrAlreadyRegistered

func (*ErrAlreadyRegistered) Error

func (e *ErrAlreadyRegistered) Error() string

type PlugConf

type PlugConf struct {
	// contains filtered or unexported fields
}

PlugConf implements a pluggable configuration store

func NewPlugConf

func NewPlugConf() *PlugConf

NewPlugConf creates a new PlugConf with a given starting map

func (*PlugConf) MustRegister

func (p *PlugConf) MustRegister(field string, proc Processor)

MustRegister is like Register but panics on failure

func (*PlugConf) Process

func (p *PlugConf) Process(config map[string]interface{}) error

Process iterates through the registered configuration outputs and emits configurations for them

func (*PlugConf) Register

func (p *PlugConf) Register(field string, proc Processor) error

Register puts a new output config in the

type Processor

type Processor func(field string, configData interface{}) error

Jump to

Keyboard shortcuts

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