Documentation
¶
Index ¶
- func AddrIfPresent[T comparable](v param.Opt[T]) *T
- func IsNullPtr[T any](ptr *T) bool
- func IsNullSlice[T any](slice []T) bool
- func NullPtr[T any]() *T
- func NullSlice[T any]() []T
- func ToOpt[T comparable](v T, meta respjson.Field) param.Opt[T]
- func Valid(v param.ParamStruct) bool
- func VariantFromUnion(u reflect.Value) (any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddrIfPresent ¶
func AddrIfPresent[T comparable](v param.Opt[T]) *T
func IsNullSlice ¶ added in v0.4.0
IsNullSlice returns true if the slice was created by NullSlice.
func NullPtr ¶ added in v0.4.0
func NullPtr[T any]() *T
NullPtr returns a pointer to the zero value of the type T. When used with [MarshalObject] or [MarshalUnion], it will be marshaled as null.
It is unspecified behavior to mutate the value pointed to by the returned pointer.
func NullSlice ¶ added in v0.4.0
func NullSlice[T any]() []T
NullSlice returns a non-nil slice with a length of 0. When used with [MarshalObject] or [MarshalUnion], it will be marshaled as null.
It is undefined behavior to mutate the slice returned by NullSlice.
func Valid ¶ added in v0.4.0
func Valid(v param.ParamStruct) bool
Checks if the value is not omitted and not null
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.