provider

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Overview

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.

Index

Constants

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

Variables

This section is empty.

Functions

func NewInMem

func NewInMem(opts Options) (config.Handler, error)

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

func NewViper

func NewViper(opts Options) (config.Handler, error)

NewViper returns a new instance of a Viper configuration provider using the provided Options opts.

Types

type InMem

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

Type InMem implements the config interface Handler for an in-memory configuration registry.

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 added in v0.1.4

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

SetObject sets an object value for the key

type Options

type Options struct {
	ServerConfig   map[string]string  // ServerConfig options are used configure the gRPC service of the adapter.
	MeshSpec       map[string]string  // MeshSpec options are used to configure the service mesh to be used.
	ProviderConfig map[string]string  // ProviderConfig options are used to configure the config provider.
	Operations     adapter.Operations // Operations contains the properties of the operations the adapter supports.
}

Type Options contains config options for various aspects of an adapter.

type Viper

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

Type 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 added in v0.1.4

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

Jump to

Keyboard shortcuts

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