generic

package
v0.0.0-...-1d79d95 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OptionallySet

type OptionallySet[T any] struct {
	Value T
	IsSet bool
}

OptionallySet allows distinguishing between "Missing Field" (Schema Cold Start) and "Zero Value" (Valid Data).

func SetOpt

func SetOpt[T any](value T) OptionallySet[T]

SetOpt is a helper that creates an OptionallySet with IsSet=true.

func UnsetOpt

func UnsetOpt[T any]() OptionallySet[T]

UnsetOpt is a helper that creates an OptionallySet with IsSet=false.

func (OptionallySet[T]) IsZero

func (o OptionallySet[T]) IsZero() bool

func (OptionallySet[T]) MarshalJSON

func (o OptionallySet[T]) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*OptionallySet[T]) UnmarshalJSON

func (o *OptionallySet[T]) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

Jump to

Keyboard shortcuts

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