Documentation ¶
Index ¶
- Variables
- func ConvertToStringSlice(value interface{}) ([]string, error)
- func ConvertToUnderlyingType(value interface{}) interface{}
- func IsZero(value interface{}) bool
- type Struct
- func (s *Struct) Field(i int) reflect.StructField
- func (s *Struct) IsPrivate(i int) bool
- func (s *Struct) IsRequired(i int, key string) bool
- func (s *Struct) NumField() int
- func (s *Struct) Set(i int, value interface{}) (err error)
- func (s *Struct) Tag(i int, key string) string
- func (s *Struct) TagInfo(i int, key string) (string, bool)
- func (s *Struct) Type(i int) reflect.Type
- func (s *Struct) Value(i int) reflect.Value
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSingleValueExpected = errors.New("expected single value, got slice")
Functions ¶
func ConvertToStringSlice ¶
ConvertToStringSlice converts value into string slice using MarshalText implementation or conversion from primitives to string.
func ConvertToUnderlyingType ¶
func ConvertToUnderlyingType(value interface{}) interface{}
ConvertToUnderlyingType takes a value ot custom type T and converts it to it's underlying types. If value is of built-in type, ConvertToUnderlyingType just returns value as provided.
Types ¶
type Struct ¶
type Struct struct {
// contains filtered or unexported fields
}
func NewStructFromValue ¶
func (*Struct) IsRequired ¶
IsRequired returns if given tag has required flag set.
Click to show internal directories.
Click to hide internal directories.