maybe

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolDecoder

func BoolDecoder() func(from reflect.Type, to reflect.Type, data interface{}) (interface{}, error)

BoolDecoder implements config parsing for maybe.Bool

Types

type Bool

type Bool struct {
	Optional[bool]
}

func False

func False() Bool

func True

func True() Bool

func (Bool) IsFalseOrUndefined

func (value Bool) IsFalseOrUndefined() bool

func (Bool) IsStrictlyFalse

func (value Bool) IsStrictlyFalse() bool

func (Bool) IsTrue

func (value Bool) IsTrue() bool

func (Bool) IsTrueOrUndefined

func (value Bool) IsTrueOrUndefined() bool

func (Bool) IsUndefined

func (value Bool) IsUndefined() bool

func (Bool) String

func (value Bool) String() string

type Optional

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

func Set

func Set[T any](value T) Optional[T]

func (Optional[T]) HasValue

func (m Optional[T]) HasValue() bool

func (Optional[T]) MarshalJSON

func (m Optional[T]) MarshalJSON() ([]byte, error)

func (*Optional[T]) UnmarshalJSON

func (m *Optional[T]) UnmarshalJSON(data []byte) error

func (Optional[T]) Value

func (m Optional[T]) Value() T

Jump to

Keyboard shortcuts

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