nullable

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Nullable

type Nullable[T any] struct {
	// contains filtered or unexported fields
}

func New

func New[T any](value T) Nullable[T]

func (*Nullable[T]) Enum added in v0.6.0

func (n *Nullable[T]) Enum() []any

func (Nullable[T]) IsNull

func (n Nullable[T]) IsNull() bool

func (Nullable[T]) IsSet

func (n Nullable[T]) IsSet() bool

func (Nullable[T]) IsZero added in v0.6.0

func (n Nullable[T]) IsZero() bool

func (*Nullable[T]) JSONSchema

func (n *Nullable[T]) JSONSchema() (jsonschema.Schema, error)

func (Nullable[T]) MarshalJSON

func (n Nullable[T]) MarshalJSON() ([]byte, error)

MarshalJSON handles JSON serialization

func (Nullable[T]) MustValue

func (n Nullable[T]) MustValue() T

func (Nullable[T]) Ptr added in v0.6.0

func (n Nullable[T]) Ptr() *T

func (*Nullable[T]) Set

func (n *Nullable[T]) Set(value T)

func (*Nullable[T]) SetNull

func (n *Nullable[T]) SetNull()

func (*Nullable[T]) UnmarshalJSON

func (n *Nullable[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON handles JSON deserialization

func (*Nullable[T]) Unset

func (n *Nullable[T]) Unset()

func (Nullable[T]) Value

func (n Nullable[T]) Value() (T, bool)

func (Nullable[T]) ValueOrDefault

func (n Nullable[T]) ValueOrDefault(defaultValue T) T

Jump to

Keyboard shortcuts

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