config

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package config provides the interface Handler and errors related to the configuration of adapters.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyConfig is returned when the config has not been initialized.
	ErrEmptyConfig = errors.New("", errors.NoneSeverity, "Config not initialized")
)

Functions

func ErrInMem

func ErrInMem(err error) error

ErrInMem returns a error wrapping err in case of an (initialization) error in the in-memory provider.

func ErrViper

func ErrViper(err error) error

ErrViper returns a error wrapping err in case of an (initialization) error in the Viper provider.

Types

type Handler

type Handler interface {
	// SetKey is used to set a string value for a given key.
	SetKey(key string, value string)
	// GetKey is used to retrieve a string value for a given key.
	GetKey(key string) string

	// GetObject is used to retrieve an object for a given key and a given interface representing that object in result.
	GetObject(key string, result interface{}) error
	// SetObject is used to set an object for a given key and a given interface representing that object in result.
	SetObject(key string, value interface{}) error

	// GetAll is used to retrieve all objects.
	GetAll(result interface{}) error

	// Is is used to check if a config is defined for a given key
	Is(key string) bool
}

Handler is the config interface to fascilitate multiple providers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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