envvar

package
v0.139.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigReader

type ConfigReader interface {
	// Get returns an interface{}.
	// For a specific value use one of the Get____ methods.
	Get(key string) (interface{}, error)

	// GetString retrieves the associated key value as a string.
	GetString(key string) (string, error)

	// Unmarshal deserializes the loaded cofig into a struct.
	Unmarshal(config interface{}) error
}

ConfigReader lists the methods exposed by ConfigReaderImpl.

type ConfigReaderBuilder

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

ConfigReaderBuilder exposes the builder api for configReaderImpl. Use NewConfigReaderBuilder() and AttachEnvPrefix() to build a ConfigReaderBuilder. Follow it up one or more calls to WithConfigFile() and/or WithConfigName() and finally use Build() to build the configReaderImpl.

func NewConfigReaderBuilder

func NewConfigReaderBuilder() ConfigReaderBuilder

NewConfigReaderBuilder builds a new ConfigReaderBuilder.

func (ConfigReaderBuilder) AttachEnvPrefix

func (b ConfigReaderBuilder) AttachEnvPrefix(appName string) ConfigReaderBuilder

AttachEnvPrefix attaches appName as prefix.

func (ConfigReaderBuilder) Build

Build Builds and returns the ConfigReader.

func (ConfigReaderBuilder) WithConfigFile

func (b ConfigReaderBuilder) WithConfigFile(configFile string) ConfigReaderBuilder

WithConfigFile attaches the passed config file.

func (ConfigReaderBuilder) WithConfigName

func (b ConfigReaderBuilder) WithConfigName(configName string, configPath ...string) ConfigReaderBuilder

WithConfigName attaches the passed config path and name.

func (ConfigReaderBuilder) WithFs

WithFs attaches the file system to use.

type NilValueError

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

NilValueError is raised when the key value is nil.

func (NilValueError) Error

func (e NilValueError) Error() string

type ValueConversionError

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

ValueConversionError is raised when the key value is incompatible with the invoked method.

func (ValueConversionError) Error

func (e ValueConversionError) Error() string

Jump to

Keyboard shortcuts

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