config

package
v2.0.0-alpha11 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// Unmarshal configuration section into configuration object.
	//
	// func (h *HttpService) Init(cp config.Provider) error {
	//     h.config := &HttpConfig{}
	//     if err := configProvider.UnmarshalKey("http", h.config); err != nil {
	//         return err
	//     }
	// }
	UnmarshalKey(name string, out interface{}) error
	// Get used to get config section
	Get(name string) interface{}
}

type ViperProvider

type ViperProvider struct {
	Path   string
	Prefix string
	// contains filtered or unexported fields
}

func (*ViperProvider) Get

func (v *ViperProvider) Get(name string) interface{}

Get raw config in a form of config section.

func (*ViperProvider) Init

func (v *ViperProvider) Init() error

////// ENDURE //////////

func (*ViperProvider) Overwrite

func (v *ViperProvider) Overwrite(values map[string]string) error

Overwrite overwrites existing config with provided values

func (*ViperProvider) UnmarshalKey

func (v *ViperProvider) UnmarshalKey(name string, out interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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