configprovider

package
v0.4.25 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ViperKey = "viper"
	InMemKey = "in-mem"
)
View Source
const (
	FilePath = "filepath"
	FileType = "filetype"
	FileName = "filename"
)

Variables

This section is empty.

Functions

func NewAdapterInMem added in v0.4.21

func NewAdapterInMem(opts InMemOptions) (adapterconfig.Handler, error)

NewAdapterInMem returns a new instance of an in-memory configuration provider using the provided Options opts.

func NewAdapterViper

func NewAdapterViper(opts ViperOptions) (adapterconfig.Handler, error)

Types

type InMem

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

func (*InMem) GetKey

func (l *InMem) GetKey(key string) string

GetKey gets a key value from local store.

func (*InMem) GetObject

func (l *InMem) GetObject(key string, result interface{}) error

GetObject gets an object value for the key.

func (*InMem) SetKey

func (l *InMem) SetKey(key string, value string)

SetKey sets a key value in local store.

func (*InMem) SetObject

func (l *InMem) SetObject(key string, value interface{}) error

SetObject sets an object value for the key.

type InMemOptions added in v0.4.21

type InMemOptions struct {
	Marshaller   utils.Marshaller
	Unmarshaller utils.Unmarshaller
	Options
}

type Options

type Options struct {
	Viper        *ViperOptions
	InMem        *InMemOptions
	ServerConfig map[string]string
	MeshSpec     map[string]string
	Operations   map[string]*adapters.Operation
}

type Viper

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

Viper implements the config interface Handler for a Viper configuration registry.

func (*Viper) GetKey

func (v *Viper) GetKey(key string) string

func (*Viper) GetObject

func (v *Viper) GetObject(key string, result interface{}) error

func (*Viper) SetKey

func (v *Viper) SetKey(key string, value string)

func (*Viper) SetObject

func (v *Viper) SetObject(key string, value interface{}) error

type ViperOptions added in v0.4.21

type ViperOptions struct {
	FilePath string
	FileType string
	FileName string
}

Jump to

Keyboard shortcuts

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