textopt

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Null

type Null[T any] opt.Null[T]

Null represents an optional value that becomes valid when it is assigned a value other than nil.

func NewNull

func NewNull[T any](value T, valid bool) Null[T]

func NullFrom

func NullFrom[T any](value T) Null[T]

func NullFromFunc

func NullFromFunc[T, U any](value *U, f func(U) T) Null[T]

func NullFromFuncPtr

func NullFromFuncPtr[T, U any](value *U, f func(*U) T) Null[T]

func NullFromPtr

func NullFromPtr[T any](value *T) Null[T]

func (Null[T]) Get

func (v Null[T]) Get() (value T, ok bool)

func (Null[T]) IsZero

func (v Null[T]) IsZero() bool

func (Null[T]) MarshalJSON

func (v Null[T]) MarshalJSON() ([]byte, error)

func (Null[T]) MarshalText

func (v Null[T]) MarshalText() ([]byte, error)

func (Null[T]) Or

func (v Null[T]) Or(value T) T

func (*Null[T]) Ptr

func (v *Null[T]) Ptr() *T

func (*Null[T]) Reset

func (v *Null[T]) Reset()

func (*Null[T]) Scan

func (v *Null[T]) Scan(value any) error

func (*Null[T]) Set

func (v *Null[T]) Set(value T)

func (Null[T]) ToSQL

func (v Null[T]) ToSQL() sql.Null[T]

func (*Null[T]) UnmarshalJSON

func (v *Null[T]) UnmarshalJSON(data []byte) error

func (*Null[T]) UnmarshalText

func (v *Null[T]) UnmarshalText(data []byte) error

func (Null[T]) Value

func (v Null[T]) Value() (driver.Value, error)

type Undefined

type Undefined[T any] opt.Undefined[T]

Undefined represents an optional value that becomes valid when it is assigned any value.

func NewUndefined

func NewUndefined[T any](value T, valid bool) Undefined[T]

func UndefinedFrom

func UndefinedFrom[T any](value T) Undefined[T]

func UndefinedFromFunc

func UndefinedFromFunc[T, U any](value *U, f func(U) T) Undefined[T]

func UndefinedFromFuncPtr

func UndefinedFromFuncPtr[T, U any](value *U, f func(*U) T) Undefined[T]

func UndefinedFromPtr

func UndefinedFromPtr[T any](value *T) Undefined[T]

func (Undefined[T]) Get

func (v Undefined[T]) Get() (value T, ok bool)

func (Undefined[T]) IsZero

func (v Undefined[T]) IsZero() bool

func (Undefined[T]) MarshalJSON

func (v Undefined[T]) MarshalJSON() ([]byte, error)

func (Undefined[T]) MarshalText

func (v Undefined[T]) MarshalText() ([]byte, error)

func (Undefined[T]) Or

func (v Undefined[T]) Or(value T) T

func (*Undefined[T]) Ptr

func (v *Undefined[T]) Ptr() *T

func (*Undefined[T]) Reset

func (v *Undefined[T]) Reset()

func (*Undefined[T]) Scan

func (v *Undefined[T]) Scan(value any) error

func (*Undefined[T]) Set

func (v *Undefined[T]) Set(value T)

func (Undefined[T]) ToSQL

func (v Undefined[T]) ToSQL() sql.Null[T]

func (*Undefined[T]) UnmarshalJSON

func (v *Undefined[T]) UnmarshalJSON(data []byte) error

func (*Undefined[T]) UnmarshalText

func (v *Undefined[T]) UnmarshalText(data []byte) error

func (Undefined[T]) Value

func (v Undefined[T]) Value() (driver.Value, error)

type Zero

type Zero[T any] opt.Zero[T]

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 NewZero

func NewZero[T any](value T, valid bool) Zero[T]

func ZeroFrom

func ZeroFrom[T any](value T) Zero[T]

func ZeroFromFunc

func ZeroFromFunc[T, U any](value *U, f func(U) T) Zero[T]

func ZeroFromFuncPtr

func ZeroFromFuncPtr[T, U any](value *U, f func(*U) T) Zero[T]

func ZeroFromPtr

func ZeroFromPtr[T any](value *T) Zero[T]

func (Zero[T]) Get

func (v Zero[T]) Get() (value T, ok bool)

func (Zero[T]) IsZero

func (v Zero[T]) IsZero() bool

func (Zero[T]) MarshalJSON

func (v Zero[T]) MarshalJSON() ([]byte, error)

func (Zero[T]) MarshalText

func (v Zero[T]) MarshalText() ([]byte, error)

func (Zero[T]) Or

func (v Zero[T]) Or(value T) T

func (*Zero[T]) Ptr

func (v *Zero[T]) Ptr() *T

func (*Zero[T]) Reset

func (v *Zero[T]) Reset()

func (*Zero[T]) Scan

func (v *Zero[T]) Scan(value any) error

func (*Zero[T]) Set

func (v *Zero[T]) Set(value T)

func (Zero[T]) ToSQL

func (v Zero[T]) ToSQL() sql.Null[T]

func (*Zero[T]) UnmarshalJSON

func (v *Zero[T]) UnmarshalJSON(data []byte) error

func (*Zero[T]) UnmarshalText

func (v *Zero[T]) UnmarshalText(data []byte) error

func (Zero[T]) Value

func (v Zero[T]) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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