cfg

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(opt *Option, pattern string, defaultValue ...any) (*gvar.Var, error)

func GetBool

func GetBool(opt *Option, pattern string, defaultValue ...bool) (bool, error)

func GetBytes

func GetBytes(opt *Option, pattern string, defaultValue ...[]byte) ([]byte, error)

func GetDuration

func GetDuration(opt *Option, pattern string, defaultValue ...time.Duration) (time.Duration, error)

func GetFloat32

func GetFloat32(opt *Option, pattern string, defaultValue ...float32) (float32, error)

func GetFloat32s

func GetFloat32s(opt *Option, pattern string, defaultValue ...[]float32) ([]float32, error)

func GetFloat64

func GetFloat64(opt *Option, pattern string, defaultValue ...float64) (float64, error)

func GetFloat64s

func GetFloat64s(opt *Option, pattern string, defaultValue ...[]float64) ([]float64, error)

func GetInt

func GetInt(opt *Option, pattern string, defaultValue ...int) (int, error)

func GetInt16

func GetInt16(opt *Option, pattern string, defaultValue ...int16) (int16, error)

func GetInt32

func GetInt32(opt *Option, pattern string, defaultValue ...int32) (int32, error)

func GetInt64

func GetInt64(opt *Option, pattern string, defaultValue ...int64) (int64, error)

func GetInt8

func GetInt8(opt *Option, pattern string, defaultValue ...int8) (int8, error)

func GetInterface

func GetInterface(opt *Option, pattern string, defaultValue ...interface{}) (interface{}, error)

func GetInts

func GetInts(opt *Option, pattern string, defaultValue ...[]int) ([]int, error)

func GetMap

func GetMap(opt *Option, pattern string, defaultValue ...map[string]interface{}) (map[string]interface{}, error)

func GetMapStrAny

func GetMapStrAny(opt *Option, pattern string, defaultValue ...map[string]interface{}) (map[string]interface{}, error)

func GetMapStrStr

func GetMapStrStr(opt *Option, pattern string, defaultValue ...map[string]string) (map[string]string, error)

func GetMapStrVar

func GetMapStrVar(opt *Option, pattern string, defaultValue ...map[string]*gvar.Var) (map[string]*gvar.Var, error)

func GetMaps

func GetMaps(opt *Option, pattern string, defaultValue ...[]map[string]interface{}) ([]map[string]interface{}, error)

func GetSlice

func GetSlice(opt *Option, pattern string, defaultValue ...[]interface{}) ([]interface{}, error)

func GetStr

func GetStr(opt *Option, pattern string, defaultValue ...string) (string, error)

func GetStrs

func GetStrs(opt *Option, pattern string, defaultValue ...[]string) ([]string, error)

func GetStructs

func GetStructs(opt *Option, pattern string, pointer any, m map[string]string, defaultValue ...map[any]any) error

func GetTime

func GetTime(opt *Option, pattern string, format string, defaultValue ...map[any]any) *gtime.Time

func GetUint16

func GetUint16(opt *Option, pattern string, defaultValue ...uint16) (uint16, error)

func GetUint32

func GetUint32(opt *Option, pattern string, defaultValue ...uint32) (uint32, error)

func GetUint64

func GetUint64(opt *Option, pattern string, defaultValue ...uint64) (uint64, error)

func GetUint8

func GetUint8(opt *Option, pattern string, defaultValue ...uint8) (uint8, error)

func GetUints

func GetUints(opt *Option, pattern string, defaultValue ...[]uint) ([]uint, error)

func GetVal

func GetVal(opt *Option, pattern string, defaultValue ...interface{}) (interface{}, error)

func Scan

func Scan(opt *Option, pattern string, pointer interface{}, m map[string]string, defaultValue ...map[any]any) error

func Struct

func Struct(opt *Option, pattern string, pointer interface{}, m map[string]string, defaultValue ...map[any]any) error

Types

type Option

type Option struct {
	Name      string
	Context   context.Context
	Must      bool
	Cmd       bool
	Env       bool
	MapOption gvar.MapOption
}

Jump to

Keyboard shortcuts

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