Documentation ¶
Index ¶
- Variables
- func Equal(obj any, path string, matchStr string) (bool, error)
- func FieldName(field reflect.StructField) string
- func FindTagValueType(t reflect.Type, key, value string) (string, bool)
- func FromMap(to any, from map[string]any) error
- func Get(obj any, path string) (any, error)
- func GetFieldType(t reflect.Type, path string) reflect.Type
- func GetValue(v reflect.Value, path string) (reflect.Value, error)
- func Greater(obj any, path string, matchStr string) (bool, error)
- func GreaterEqual(obj any, path string, matchStr string) (bool, error)
- func HasPrefix(obj any, path string, matchStr string) (bool, error)
- func In(obj any, path string, matchStr string) (bool, error)
- func Less(obj any, path string, matchStr string) (bool, error)
- func LessEqual(obj any, path string, matchStr string) (bool, error)
- func List(obj any) []string
- func ListType(t reflect.Type) []string
- func MaybeIndirectType(t reflect.Type) reflect.Type
- func Merge(to, from any)
- func MergeMap(to any, from map[string]any) error
- func MergeMaps(to map[string]any, from map[string]any)
- func MergeValue(to, from reflect.Value)
- func Set(obj any, path string, val string) error
- func SetValue(v reflect.Value, path string, val string) error
- func Sort(objs any, path string) error
- func SortReverse(objs any, path string) error
- func ToMap(from any) (map[string]any, error)
- func Walk(obj any, cb WalkCallback)
- func WalkType(t reflect.Type, cb WalkCallback)
- type WalkCallback
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupportedType = errors.New("unsupported type") ErrUnknownTimeFormat = errors.New("unknown time format") )
View Source
var ( TimeTimeType = reflect.TypeOf(time.Time{}) CivilDateType = reflect.TypeOf(civil.Date{}) ErrNotAStruct = errors.New("not a struct") ErrUnknownFieldName = errors.New("unknown field name") )
View Source
var ErrUnsupportedSortType = errors.New("unsupported _sort type")
Functions ¶
func FieldName ¶
func FieldName(field reflect.StructField) string
func MergeValue ¶
func SortReverse ¶
func Walk ¶
func Walk(obj any, cb WalkCallback)
func WalkType ¶
func WalkType(t reflect.Type, cb WalkCallback)
Types ¶
type WalkCallback ¶
type WalkCallback func(string, []string, reflect.StructField)
Click to show internal directories.
Click to hide internal directories.