Documentation ¶
Index ¶
- Variables
- func Author() string
- func IsStruct(v interface{}) bool
- func License() string
- func Map(v interface{}) (map[string]interface{}, error)
- func Name(v interface{}) (string, error)
- func Names(v interface{}) ([]string, error)
- func Set(v interface{}, name string, value interface{}) error
- func Tags(v interface{}, key string) (map[string]string, error)
- func Values(v interface{}) ([]interface{}, error)
- func Version() string
- func Zero(v interface{}, name string) error
- type Fieldx
- func (f *Fieldx) Addr() interface{}
- func (f *Fieldx) IsAnonymous() bool
- func (f *Fieldx) IsExport() bool
- func (f *Fieldx) IsZero() bool
- func (f *Fieldx) Kind() reflect.Kind
- func (f *Fieldx) Name() string
- func (f *Fieldx) Set(v interface{}) error
- func (f *Fieldx) Tag(key string) string
- func (f *Fieldx) Value() interface{}
- func (f *Fieldx) Zero() error
- type Structx
- func (s *Structx) Field(name string) (*Fieldx, bool)
- func (s *Structx) Fields() []*Fieldx
- func (s *Structx) HasField(name string) bool
- func (s *Structx) IsStruct(name string) bool
- func (s *Structx) Map() map[string]interface{}
- func (s *Structx) MustField(name string) *Fieldx
- func (s *Structx) Name() string
- func (s *Structx) Names() []string
- func (s *Structx) Set(name string, value interface{}) error
- func (s *Structx) Struct(name string) (*Structx, error)
- func (s *Structx) Tags(key string) map[string]string
- func (s *Structx) Values() []interface{}
- func (s *Structx) Zero(name string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotStruct not a valid struct ErrNotStruct = errors.New("xstruct: not a valid struct") // ErrNoField field name is not exists ErrNoField = errors.New("xstruct: field name is not exists") // ErrNotExported not an exported field ErrNotExported = errors.New("xstruct: not an exported field") // ErrNotSettable not a settable field ErrNotSettable = errors.New("xstruct: not a settable field") )
Functions ¶
Types ¶
type Fieldx ¶
type Fieldx struct {
// contains filtered or unexported fields
}
Fieldx storing struct field
func (*Fieldx) Addr ¶ added in v0.24.4
func (f *Fieldx) Addr() interface{}
Addr returns address of field
func (*Fieldx) IsAnonymous ¶
IsAnonymous returns if field is anonymous
func (*Fieldx) IsZero ¶
IsZero returns if field have zero value, for example not initialized it panic if field is not exported
type Structx ¶
type Structx struct {
// contains filtered or unexported fields
}
Structx storing struct data
Click to show internal directories.
Click to hide internal directories.