optional

package
v1.22.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 2 Imported by: 57

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option[T any] []T

func FromNonDefault

func FromNonDefault[T comparable](v T) Option[T]

func FromPtr

func FromPtr[T any](v *T) Option[T]

func None

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

func Some

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

func (Option[T]) Has

func (o Option[T]) Has() bool

func (Option[T]) MarshalJSON

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

func (Option[T]) MarshalYAML

func (o Option[T]) MarshalYAML() (any, error)

func (*Option[T]) UnmarshalJSON

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

func (*Option[T]) UnmarshalYAML

func (o *Option[T]) UnmarshalYAML(value *yaml.Node) error

func (Option[T]) Value

func (o Option[T]) Value() T

func (Option[T]) ValueOrDefault

func (o Option[T]) ValueOrDefault(v T) T

Jump to

Keyboard shortcuts

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