config

package
v0.0.0-...-ad6d8b1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const PACKAGR_ENGINE_REPO_CONFIG_PATH = "engine_repo_config_path"

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConfiguration

type BaseConfiguration struct {
	*viper.Viper
}

When initializing this class the following methods must be called: Config.New Config.Init This is done automatically when created via the Factory.

func New

func New() *BaseConfiguration

func (*BaseConfiguration) Init

func (c *BaseConfiguration) Init() error

func (*BaseConfiguration) ParseProviders

func (c *BaseConfiguration) ParseProviders() (map[string]map[string]provider.Interface, error)

func (*BaseConfiguration) ReadConfig

func (c *BaseConfiguration) ReadConfig(configFilePath string) error

type Interface

type Interface interface {
	Init() error
	Set(key string, value interface{})
	SetDefault(key string, value interface{})
	AllSettings() map[string]interface{}
	IsSet(key string) bool
	Get(key string) interface{}
	GetBool(key string) bool
	GetInt(key string) int
	GetString(key string) string
	GetStringSlice(key string) []string
	UnmarshalKey(key string, rawVal interface{}, decoder ...viper.DecoderConfigOption) error
	ReadConfig(configFilePath string) error
}

Create mock using: mockgen -source=pkg/config/interface.go -destination=pkg/config/mock/mock_config.go

func Create

func Create() (Interface, error)

Jump to

Keyboard shortcuts

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