binder

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RegisterCmdArgs RegisterFunc = defaultRegisterCmdArgsFlagStd

	LoadConfig  LoadConfigFunc = defaultLoadConfig
	SaveConfig  SaveConfigFunc = defaultSaveConfig
	SaveOnClose                = false

	TagName = "bind"
)
View Source
var (
	ErrHandlerNotSet = errors.New("handler not set")
)

Functions

func BindArgs

func BindArgs(st interface{}, key string) (err error)

func BindArgsConf

func BindArgsConf(st interface{}, key string) (err error)

func BindConf

func BindConf(st interface{}, key string) (err error)

func Close

func Close() (err error)

func CopyValue added in v1.1.0

func CopyValue(src, dst reflect.Value)

func FillValue added in v1.1.0

func FillValue(v reflect.Value) reflect.Value

func In

func In()

func Init

func Init() (err error)

func JoinTag

func JoinTag(tag map[string]string) reflect.StructTag
func Link(f interface{}) (interface{}, func(), func())

Link creates an intermediate struct of original struct fields

func Out

func Out()

func ParseTag

func ParseTag(tag string) (value map[string]string)

func Save

func Save() (err error)

func SplitTagValue

func SplitTagValue(value string) []string

func UnwindType added in v1.1.0

func UnwindType(v reflect.Type, usingLastPtr bool) (r reflect.Type, pc int)

func UnwindValue added in v1.1.0

func UnwindValue(v reflect.Value, fillNil bool, usingLastPtr bool) (r reflect.Value, pc int)

func WindType added in v1.1.0

func WindType(v reflect.Type, pc int) (r reflect.Type)

Types

type LoadConfigFunc

type LoadConfigFunc func(mc *MappedConfiguration) error

Passed *MappedConfiguration

type MappedConfiguration

type MappedConfiguration map[string]interface{}

type RegisterFunc

type RegisterFunc func(parent string, fieldType reflect.StructField, fieldValue reflect.Value)

type SaveConfigFunc

type SaveConfigFunc func(mc *MappedConfiguration) error

Directories

Path Synopsis
ext

Jump to

Keyboard shortcuts

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