utils

package
v1.64.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: MIT Imports: 1 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 NewNullable

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

Create a new Nullable[T] from a value

func NewNullableFromPtr

func NewNullableFromPtr[T any](value *T) Nullable[T]

Create a new Nullable[T] from a pointer to a value

If you need to create an Nullable[string] that is explicitly set to nil, use this method

func NewUnsetNullable

func NewUnsetNullable[T any]() Nullable[T]

Create a new Nullable[T] that is unset, This type will not be emitted when serializing

func (Nullable[T]) Get

func (v Nullable[T]) Get() *T

func (Nullable[T]) IsSet

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

func (Nullable[T]) MarshalJSON

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

func (*Nullable[T]) Set

func (v *Nullable[T]) Set(val *T)

func (*Nullable[T]) UnmarshalJSON

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

func (*Nullable[T]) Unset

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

Jump to

Keyboard shortcuts

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