Documentation ¶
Index ¶
- type ConfigOptional
- type NoneError
- type Option
- func (o *Option[T]) BinaryTransform(second T, f func(T, T) (T, error)) error
- func (o *Option[T]) Clear()
- func (o Option[T]) Eq(other Optional[T]) bool
- func (o Option[T]) IsNone() bool
- func (o Option[T]) IsSome() bool
- func (o Option[T]) Match(probe T) bool
- func (o *Option[T]) Set(value T)
- func (o *Option[T]) Transform(f func(T) (T, error)) error
- func (o *Option[T]) TransformOr(f func(T) (T, error), backup T)
- func (o *Option[T]) TransformOrElse(f func(T) (T, error), backup func() T)
- func (o *Option[T]) UnmarshalJSON(data []byte) error
- func (o *Option[T]) UnsafeUnwrap() T
- func (o *Option[T]) Unwrap() (T, error)
- func (o *Option[T]) UnwrapOrDefault(def T) T
- func (o *Option[T]) UnwrapOrElse(f func() T) T
- type Optional
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigOptional ¶
type NoneError ¶
type NoneError struct {
// contains filtered or unexported fields
}
func NewNoneError ¶
type Option ¶
type Option[T comparable] struct { // contains filtered or unexported fields }
func None ¶
func None[T comparable]() Option[T]
func Some ¶
func Some[T comparable](value T) Option[T]
func (*Option[T]) BinaryTransform ¶
func (*Option[T]) TransformOr ¶
func (*Option[T]) TransformOrElse ¶
func (*Option[T]) UnmarshalJSON ¶
Unmarshaller interface
func (*Option[T]) UnsafeUnwrap ¶
func (o *Option[T]) UnsafeUnwrap() T
func (*Option[T]) UnwrapOrDefault ¶
func (o *Option[T]) UnwrapOrDefault(def T) T
func (*Option[T]) UnwrapOrElse ¶
func (o *Option[T]) UnwrapOrElse(f func() T) T
type Optional ¶
type Optional[T comparable] interface { IsSome() bool IsNone() bool Clear() Set(T) Unwrap() (T, error) UnsafeUnwrap() T UnwrapOrDefault(T) T UnwrapOrElse(func() T) T Match(T) bool Eq(Optional[T]) bool Transform(func(T) (T, error)) error TransformOr(func(T) (T, error), T) TransformOrElse(func(T) (T, error), func() T) BinaryTransform(second T, f func(T, T) error) error }
Click to show internal directories.
Click to hide internal directories.