config

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Operation keys
	InstallKumav071 = "install-kuma-0.7.1" // InstallKuma is the key to install kuma
	InstallKumav070 = "install-kuma-0.7.0" // InstallKuma is the key to install kuma
	InstallKumav060 = "install-kuma-0.6.0" // InstallKuma is the key to install kuma

	InstallSampleBookInfo = "install-sample-bookinfo" // InstallSampleBookInfo is the key to install sample bookinfo application

	ValidateSmiConformance = "validate-smi-conformance" // ValidateSmiConformance is the key to run and validate smi conformance test

	RunningMeshVersion = "running_mesh_version" // RunningMeshVersion is the key to store the current running version of the mesh
)

Variables

View Source
var (
	// ErrEmptyConfig is the error object for empty config
	ErrEmptyConfig = errors.New(errors.ErrEmptyConfig, "Config not initialized")
)

Functions

func ErrViper

func ErrViper(err error) error

ErrViper is the error object for viper

Types

type Handler

type Handler interface {

	// SetKey sets a key value in the config
	SetKey(key string, value string)

	// GetKey gets a key value from the config
	GetKey(key string) string

	// Server provides the server specific configuration
	Server(result interface{}) error

	// MeshSpec provides the mesh specific configuration
	MeshSpec(result interface{}) error

	// MeshInstance provides the mesh specific configuration
	MeshInstance(result interface{}) error

	// Operations provides the list of operations available
	Operations(result interface{}) error
}

Handler is the handler interface for config

func New

func New(name string) (Handler, error)

New returns the interface of the config handler

func NewLocal

func NewLocal() (Handler, error)

NewLocal intializes a local instance and dependencies

func NewViper

func NewViper() (Handler, error)

NewViper intializes a viper instance and dependencies

type Local

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

Local instance for configuration

func (*Local) GetKey

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

GetKey gets a key value from local store

func (*Local) MeshInstance

func (l *Local) MeshInstance(result interface{}) error

MeshInstance provides mesh specific configuration

func (*Local) MeshSpec

func (l *Local) MeshSpec(result interface{}) error

MeshSpec provides mesh specific configuration

func (*Local) Operations

func (l *Local) Operations(result interface{}) error

Operations provides operations in the mesh

func (*Local) Server

func (l *Local) Server(result interface{}) error

Server provides server specific configuration

func (*Local) SetKey

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

SetKey sets a key value in local store

type Viper

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

Viper instance for configuration

func (*Viper) GetKey

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

GetKey gets a key value from viper

func (*Viper) MeshInstance

func (v *Viper) MeshInstance(result interface{}) error

MeshInstance provides mesh specific configuration

func (*Viper) MeshSpec

func (v *Viper) MeshSpec(result interface{}) error

MeshSpec provides mesh specific configuration

func (*Viper) Operations

func (v *Viper) Operations(result interface{}) error

Operations provides list of operations available

func (*Viper) Server

func (v *Viper) Server(result interface{}) error

Server provides server specific configuration

func (*Viper) SetKey

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

SetKey sets a key value in viper

Jump to

Keyboard shortcuts

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