config

package
v0.7.41 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 1 Imported by: 12

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 (
	ErrEmptyConfigCode = "meshkit-11123"
	ErrViperCode       = "meshkit-11124"
	ErrInMemCode       = "meshkit-11125"

	// ErrEmptyConfig is returned when the config has not been initialized.
	ErrEmptyConfig = errors.New(ErrEmptyConfigCode, errors.Alert, []string{"Config not initialized"}, []string{}, []string{"Viper is crashing"}, []string{"Make sure viper is configured properly"})
)

Functions

func ErrInMem

func ErrInMem(err error) error

ErrViper returns a MeshKit error indicating an (initialization) error in the in-memory provider.

func ErrViper

func ErrViper(err error) error

ErrViper returns a MeshKit error indicating 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.
	// An example of such an object is map[string]string. These objects can e.g. be set in the factory function for a specific
	// config provider implementation.
	GetObject(key string, result interface{}) error

	SetObject(key string, value interface{}) error
}

Interface Handler is the interface to be implemented by config providers used by adapters.

Provided implementations can be found in the package config/provider.

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