configuration

package
v0.0.0-...-97ce03a Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProvideFolderContent = errors.New("provide_folder content type error")
View Source
var ErrProvideFolderNotSet = errors.New("provide_folder not find in config")
View Source
var ErrProvideFolderType = errors.New("provide_folder in config type error")

Functions

This section is empty.

Types

type VConfig

type VConfig struct {
	*viper.Viper
	// contains filtered or unexported fields
}
var Config *VConfig

func ReadConfig

func ReadConfig(configPath string) (*VConfig, error)

func (*VConfig) Get

func (c *VConfig) Get(key string, defaultValue interface{}) interface{}

func (*VConfig) GetBool

func (c *VConfig) GetBool(key string, defaultValue bool) (bool, error)

func (*VConfig) GetConfigAsString

func (c *VConfig) GetConfigAsString() (string, error)

func (*VConfig) GetFloat64

func (c *VConfig) GetFloat64(key string, defaultValue float64) (float64, error)

func (*VConfig) GetInt

func (c *VConfig) GetInt(key string, defaultValue int) (int, error)

func (*VConfig) GetIntSlice

func (c *VConfig) GetIntSlice(key string, defaultValue []int) ([]int, error)

func (*VConfig) GetProvideFolders

func (c *VConfig) GetProvideFolders() ([]folderMgr.FolderConfig, error)

example read provide_folder

func (*VConfig) GetString

func (c *VConfig) GetString(key string, defaultValue string) (string, error)

func (*VConfig) GetStringMap

func (c *VConfig) GetStringMap(key string, defaultValue map[string]interface{}) (map[string]interface{}, error)

func (*VConfig) GetStringSlice

func (c *VConfig) GetStringSlice(key string, defaultValue []string) ([]string, error)

func (*VConfig) SetProvideFolders

func (c *VConfig) SetProvideFolders(pf []folderMgr.FolderConfig)

Jump to

Keyboard shortcuts

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