Documentation
¶
Index ¶
- Variables
- func Create(t reflect.Type) reflect.Value
- func CreateFor[T any]() reflect.Value
- func Each(v any, cb func(v reflect.Value, pointer bool) error) error
- func EachField(v reflect.Value, cb func(sf reflect.StructField, fv reflect.Value) error) error
- func ExponentialFalloff(n int) time.Duration
- func FieldName(f reflect.StructField) string
- func GetFields(t reflect.Type) []reflect.StructField
- func GetValue(v any, key string) (any, bool)
- func HasField(v any, field string) bool
- func Includes[T comparable](arr []T, v T) bool
- func NewOf[T any]() (T, error)
- func PrimaryKey(m any) []string
- func PrimaryKeyFields(m any) []reflect.StructField
- func PrimaryKeyValue(m any) ([]any, error)
- func RGetValue(v reflect.Value, key string) (reflect.Value, error)
- func RNewOf(t reflect.Type) (reflect.Value, error)
- func RPrimaryKeyFields(t reflect.Type) []reflect.StructField
- func Zero[T any]() T
- type PrimaryKeyer
- type Tag
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrExpectedStruct = fmt.Errorf("expected a struct")
)
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
func ExponentialFalloff ¶
func FieldName ¶
func FieldName(f reflect.StructField) string
func Includes ¶
func Includes[T comparable](arr []T, v T) bool
func PrimaryKey ¶
func PrimaryKeyFields ¶
func PrimaryKeyFields(m any) []reflect.StructField
func PrimaryKeyValue ¶
func RPrimaryKeyFields ¶
func RPrimaryKeyFields(t reflect.Type) []reflect.StructField
Types ¶
type PrimaryKeyer ¶
type PrimaryKeyer interface {
PrimaryKey() []string
}
Click to show internal directories.
Click to hide internal directories.