Documentation
¶
Index ¶
- type Null
- func (v Null[T]) Get() (value T, ok bool)
- func (v Null[T]) IsZero() bool
- func (v Null[T]) MarshalJSON() ([]byte, error)
- func (v Null[T]) MarshalText() ([]byte, error)
- func (v Null[T]) Or(value T) T
- func (v *Null[T]) Ptr() *T
- func (v *Null[T]) Reset()
- func (v *Null[T]) Scan(value any) error
- func (v *Null[T]) Set(value T)
- func (v Null[T]) ToSQL() sql.Null[T]
- func (v *Null[T]) UnmarshalJSON(data []byte) error
- func (v *Null[T]) UnmarshalText(data []byte) error
- func (v Null[T]) Value() (driver.Value, error)
- type Undefined
- func NewUndefined[T any](value T, valid bool) Undefined[T]
- func UndefinedFrom[T any](value T) Undefined[T]
- func UndefinedFromFunc[T, U any](value *U, f func(U) T) Undefined[T]
- func UndefinedFromFuncPtr[T, U any](value *U, f func(*U) T) Undefined[T]
- func UndefinedFromPtr[T any](value *T) Undefined[T]
- func (v Undefined[T]) Get() (value T, ok bool)
- func (v Undefined[T]) IsZero() bool
- func (v Undefined[T]) MarshalJSON() ([]byte, error)
- func (v Undefined[T]) MarshalText() ([]byte, error)
- func (v Undefined[T]) Or(value T) T
- func (v *Undefined[T]) Ptr() *T
- func (v *Undefined[T]) Reset()
- func (v *Undefined[T]) Scan(value any) error
- func (v *Undefined[T]) Set(value T)
- func (v Undefined[T]) ToSQL() sql.Null[T]
- func (v *Undefined[T]) UnmarshalJSON(data []byte) error
- func (v *Undefined[T]) UnmarshalText(data []byte) error
- func (v Undefined[T]) Value() (driver.Value, error)
- type Zero
- func (v Zero[T]) Get() (value T, ok bool)
- func (v Zero[T]) IsZero() bool
- func (v Zero[T]) MarshalJSON() ([]byte, error)
- func (v Zero[T]) MarshalText() ([]byte, error)
- func (v Zero[T]) Or(value T) T
- func (v *Zero[T]) Ptr() *T
- func (v *Zero[T]) Reset()
- func (v *Zero[T]) Scan(value any) error
- func (v *Zero[T]) Set(value T)
- func (v Zero[T]) ToSQL() sql.Null[T]
- func (v *Zero[T]) UnmarshalJSON(data []byte) error
- func (v *Zero[T]) UnmarshalText(data []byte) error
- func (v Zero[T]) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Null ¶
Null represents an optional value that becomes valid when it is assigned a value other than nil.
func NullFromFunc ¶
func NullFromFuncPtr ¶
func NullFromPtr ¶
func (Null[T]) MarshalJSON ¶
func (Null[T]) MarshalText ¶
func (*Null[T]) UnmarshalJSON ¶
func (*Null[T]) UnmarshalText ¶
type Undefined ¶
Undefined represents an optional value that becomes valid when it is assigned any value.
func NewUndefined ¶
func UndefinedFrom ¶
func UndefinedFromFunc ¶
func UndefinedFromFuncPtr ¶
func UndefinedFromPtr ¶
func (Undefined[T]) MarshalJSON ¶
func (Undefined[T]) MarshalText ¶
func (*Undefined[T]) UnmarshalJSON ¶
func (*Undefined[T]) UnmarshalText ¶
type Zero ¶
Zero represents an optional value that becomes valid when it is assigned a value other than nil or zero.
Value is considered zero according to rules: 1) If type T has an "IsZero() bool" method, that returns true for the value. 2) Otherwise, the value is zero if it is the zero value for type T.
func ZeroFromFunc ¶
func ZeroFromFuncPtr ¶
func ZeroFromPtr ¶
func (Zero[T]) MarshalJSON ¶
func (Zero[T]) MarshalText ¶
func (*Zero[T]) UnmarshalJSON ¶
func (*Zero[T]) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.