config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 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
}

Handler is the config interface to fascilitate multiple providers

Directories

Path Synopsis
Package provider provides config provider implementations that can be used in the adapters, as well as the Options type containing options for various aspects of an adapter.
Package provider provides config provider implementations that can be used in the adapters, as well as the Options type containing options for various aspects of an adapter.

Jump to

Keyboard shortcuts

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