config

package
v0.0.0-...-764ed56 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmbedConfig

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

EmbedConfig embeded config

func NewEmbedConfig

func NewEmbedConfig(config interface{}) *EmbedConfig

NewEmbedConfig new embed config instance

func (*EmbedConfig) Get

func (e *EmbedConfig) Get(k string) interface{}

Get object

func (*EmbedConfig) GetBool

func (e *EmbedConfig) GetBool(k string) bool

GetBool get bool value

func (*EmbedConfig) GetConfig

func (e *EmbedConfig) GetConfig(k string) Getter

GetConfig get config

func (*EmbedConfig) GetFloat64

func (e *EmbedConfig) GetFloat64(k string) float64

GetFloat64 get float64 value

func (*EmbedConfig) GetInt

func (e *EmbedConfig) GetInt(k string) int

GetInt get int value

func (*EmbedConfig) GetString

func (e *EmbedConfig) GetString(k string) string

GetString get string value

func (*EmbedConfig) GetStringMap

func (e *EmbedConfig) GetStringMap(k string) map[string]interface{}

GetStringMap get map string interface value

func (*EmbedConfig) GetStringMapString

func (e *EmbedConfig) GetStringMapString(k string) map[string]string

GetStringMapString get map string string value

func (*EmbedConfig) GetStringSlice

func (e *EmbedConfig) GetStringSlice(k string) []string

GetStringSlice get string slice value

func (*EmbedConfig) Unmarshal

func (e *EmbedConfig) Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error

Unmarshal unmarshal

type Getter

type Getter interface {
	Get(k string) interface{}
	GetString(k string) string
	GetBool(k string) bool
	GetInt(k string) int
	GetFloat64(k string) float64
	GetStringSlice(k string) []string
	GetStringMap(k string) map[string]interface{}
	GetStringMapString(k string) map[string]string
	Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error
}

Getter config getter interface

func Load

func Load(def map[string]interface{}, urlStr string) (Getter, error)

Load load configuration from config url, by default will load environment variable

Jump to

Keyboard shortcuts

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