path

package module
v0.0.0-...-d6e8060 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Index

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 Equal

func Equal(obj any, path string, matchStr string) (bool, error)

func FieldName

func FieldName(field reflect.StructField) string

func FindTagValueType

func FindTagValueType(t reflect.Type, key, value string) (string, bool)

func FromMap

func FromMap(to any, from map[string]any) error

func Get

func Get(obj any, path string) (any, error)

func GetFieldType

func GetFieldType(t reflect.Type, path string) reflect.Type

func GetValue

func GetValue(v reflect.Value, path string) (reflect.Value, error)

func Greater

func Greater(obj any, path string, matchStr string) (bool, error)

func GreaterEqual

func GreaterEqual(obj any, path string, matchStr string) (bool, error)

func HasPrefix

func HasPrefix(obj any, path string, matchStr string) (bool, error)

func In

func In(obj any, path string, matchStr string) (bool, error)

func Less

func Less(obj any, path string, matchStr string) (bool, error)

func LessEqual

func LessEqual(obj any, path string, matchStr string) (bool, error)

func List

func List(obj any) []string

func ListType

func ListType(t reflect.Type) []string

func MaybeIndirectType

func MaybeIndirectType(t reflect.Type) reflect.Type

func Merge

func Merge(to, from any)

func MergeMap

func MergeMap(to any, from map[string]any) error

func MergeMaps

func MergeMaps(to map[string]any, from map[string]any)

func MergeValue

func MergeValue(to, from reflect.Value)

func Set

func Set(obj any, path string, val string) error

func SetValue

func SetValue(v reflect.Value, path string, val string) error

func Sort

func Sort(objs any, path string) error

func SortReverse

func SortReverse(objs any, path string) error

func ToMap

func ToMap(from any) (map[string]any, error)

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)

Jump to

Keyboard shortcuts

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