Documentation
¶
Index ¶
- type Field
- func Bool(value bool) *Field[bool]
- func Float(value float32) *Field[float32]
- func Float64(value float64) *Field[float64]
- func Int(value int) *Field[int]
- func Int32(value int32) *Field[int32]
- func Int64(value int64) *Field[int64]
- func Null[T any]() *Field[T]
- func String(value string) *Field[string]
- func Value[T any](value T) *Field[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field[T any] struct { // contains filtered or unexported fields }
Field is a wrapper for nullable fields to distinguish zero values from null or omitted fields.
func Value ¶
Value is a nullable field helper for constructing a generic nullable field with a value.
func (Field[T]) MarshalJSON ¶
func (*Field[T]) UnmarshalJSON ¶
func (*Field[T]) Value ¶
func (f *Field[T]) Value() *T
Value returns the value of the nullable field if the field is present and has value set. Using Value you loose information about nullability, i.e. it is no longer possible to distinguish between the field not being present or the field being present as null.
Click to show internal directories.
Click to hide internal directories.