config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFileName = "configuration.toml"
View Source
const PathId = "/id/"
View Source
const PathName = "/name/"
View Source
const SampleConfigFileName = "sample-configuration.toml"

Variables

View Source
var DefaultConfigFile = filepath.Join(os.Getenv("HOME"), ".edgex-cli", ConfigFileName)

Functions

func LoadConfig

func LoadConfig(env Environment) error

Types

type Client

type Client struct {
	Host     string
	Protocol string
	Port     int
}

func (Client) Url

func (c Client) Url() string

type ClientInfo

type ClientInfo map[string]Client

type Configuration

type Configuration struct {
	Clients ClientInfo
}

Configuration struct will use this to write config file eventually

var Conf Configuration

type Environment

type Environment interface {
	SetConfigFile(string)
	GetString(string) string
	IsSet(string) bool
}

func NewViperEnv

func NewViperEnv() Environment

type Security

type Security struct {
	Enabled bool
	Token   string
}

Security struct for security related config

type ViperEnv

type ViperEnv struct{}

func (ViperEnv) GetString

func (ViperEnv) GetString(key string) string

func (ViperEnv) IsSet

func (ViperEnv) IsSet(aStr string) bool

func (ViperEnv) SetConfigFile

func (ViperEnv) SetConfigFile(configFilePath string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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