optional

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 Type

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

func New

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

func (*Type[T]) Enum

func (*Type[T]) Enum() []any

func (Type[T]) IsNull

func (t Type[T]) IsNull() bool

func (Type[T]) IsSet

func (t Type[T]) IsSet() bool

func (Type[T]) IsZero

func (t Type[T]) IsZero() bool

func (*Type[T]) JSONSchema

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

func (Type[T]) MarshalJSON

func (t Type[T]) MarshalJSON() ([]byte, error)

MarshalJSON handles JSON serialization

func (Type[T]) MustValue

func (t Type[T]) MustValue() T

func (Type[T]) Ptr

func (t Type[T]) Ptr() *T

func (*Type[T]) Set

func (t *Type[T]) Set(value T)

func (*Type[T]) SetNull

func (t *Type[T]) SetNull()

func (*Type[T]) UnmarshalJSON

func (t *Type[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON handles JSON deserialization

func (*Type[T]) Unset

func (t *Type[T]) Unset()

func (Type[T]) Value

func (t Type[T]) Value() (T, bool)

func (Type[T]) ValueOrDefault

func (t Type[T]) ValueOrDefault(defaultValue T) T

func (Type[T]) ValueOrZero

func (t Type[T]) ValueOrZero() T

Jump to

Keyboard shortcuts

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