optional

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option[T any] struct {
	Value T
	Valid bool
}

func None

func None[T any]() Option[T]

func Some

func Some[T any](v T) Option[T]

func (Option[T]) MarshalBinary

func (o Option[T]) MarshalBinary() (data []byte, err error)

MarshalBinary implements encoding.BinaryMarshaler.

func (Option[T]) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (Option[T]) MarshalText

func (o Option[T]) MarshalText() (text []byte, err error)

MarshalText implements encoding.TextMarshaler.

func (Option[T]) UnmarshalBinary

func (o Option[T]) UnmarshalBinary(data []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler.

func (Option[T]) UnmarshalJSON

func (o Option[T]) UnmarshalJSON([]byte) error

UnmarshalJSON implements json.Unmarshaler.

func (Option[T]) UnmarshalText

func (o Option[T]) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

Jump to

Keyboard shortcuts

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