Documentation
¶
Index ¶
- Constants
- Variables
- func LoadAsSlice[T encoding.TextUnmarshaler](l *Loader, mode int, key string) (result []T, err error)
- func ObjectBind(src map[string]any, dst any, attr *LoaderAttr, alias Alias) error
- func StringLoad(getter func(string) string, loader *LoaderAttr, v any, alias Alias) error
- type Alias
- type Loader
- func (l *Loader) Bind(v any) error
- func (l *Loader) LazyLoad(mode int, key string) []string
- func (l *Loader) LoadAs(mode int, key string, u encoding.TextUnmarshaler) error
- func (l *Loader) LoadAsBool(mode int, key string) bool
- func (l *Loader) LoadAsFloat64(mode int, key string, bitsize int) (float64, error)
- func (l *Loader) LoadAsInt(mode int, key string, bitsize int) (int64, error)
- func (l *Loader) LoadAsUint(mode int, key string, bitsize int) (uint64, error)
- func (l *Loader) LoadString(mode int, key string) (string, error)
- func (l *Loader) Parse(args []string) error
- func (l *Loader) SetAttr(tagname string, wordTranslate func(string) string)
- type LoaderAttr
Constants ¶
View Source
const ( NotFound strerror = "not found resource" ErrDuplicate strerror = "duplicate error" TypeNotSupport strerror = "type not support" )
View Source
const ( Long = 1 Short = 2 Required = 4 )
found mode
Variables ¶
View Source
var Default = NewLoader()
Functions ¶
func LoadAsSlice ¶
func ObjectBind ¶
func StringLoad ¶
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func (*Loader) LoadAsFloat64 ¶
func (*Loader) LoadAsUint ¶
type LoaderAttr ¶
type LoaderAttr struct {
// contains filtered or unexported fields
}
func NewLoaderAttr ¶
func NewLoaderAttr(tagname string, wordTranslate func(string) string) *LoaderAttr
Click to show internal directories.
Click to hide internal directories.