optional

package
v1.0.34 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Optional

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

func OfCommaErr

func OfCommaErr[T any](value T, e error) *Optional[T]

func OfCommaOk

func OfCommaOk[T any](value T, ok bool) *Optional[T]

func OfEmpty

func OfEmpty[T any]() *Optional[T]

func OfEntry

func OfEntry[K comparable, V any](m map[K]V, key K) *Optional[V]

func OfNilable

func OfNilable[T any](value T) *Optional[T]

func OfValue

func OfValue[T any](value T) *Optional[T]

func (*Optional[T]) OrElse

func (this *Optional[T]) OrElse(value T) T

func (*Optional[T]) OrElseOptional

func (this *Optional[T]) OrElseOptional(other *Optional[T]) *Optional[T]

func (*Optional[T]) OrElsePanic

func (this *Optional[T]) OrElsePanic(format string, a ...any) T

func (*Optional[T]) Present

func (this *Optional[T]) Present() bool

func (*Optional[T]) Value

func (this *Optional[T]) Value() T

Jump to

Keyboard shortcuts

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