Documentation
¶
Index ¶
- type Error
- func (err Error[T]) DoIf(op.Operator[T], func(T) Result[T]) Result[T]
- func (err Error[T]) DoIfError(operator op.Operator[error], do func(error) Result[T]) Result[T]
- func (err Error[T]) Error(call func(error) Result[T]) Result[T]
- func (err Error[T]) If(op.Operator[T]) bool
- func (err Error[T]) IfError(operator op.Operator[error]) bool
- func (err Error[T]) Or(value T) Result[T]
- func (err Error[T]) String() string
- func (err Error[T]) Then(func(T) Result[T]) Result[T]
- func (err Error[T]) TryError() error
- func (err Error[T]) TryValue() T
- func (err Error[T]) WhenError(call func(error)) Result[T]
- func (err Error[T]) WhenOK(func(T)) Result[T]
- type Maybe
- type MaybeIsNothingError
- type Nothing
- func (nothing Nothing[T]) DoIf(op.Operator[T], func(T) Maybe[T]) Maybe[T]
- func (nothing Nothing[T]) Else(call func() Maybe[T]) Maybe[T]
- func (nothing Nothing[T]) If(op.Operator[T]) bool
- func (nothing Nothing[T]) Or(value T) Maybe[T]
- func (Nothing[T]) String() string
- func (nothing Nothing[T]) Then(func(T) Maybe[T]) Maybe[T]
- func (Nothing[T]) TryValue() T
- func (nothing Nothing[T]) WhenNothing(call func()) Maybe[T]
- func (nothing Nothing[T]) WhenValue(func(T)) Maybe[T]
- type OK
- func (ok OK[T]) DoIf(comparator op.Operator[T], do func(T) Result[T]) Result[T]
- func (ok OK[T]) DoIfError(op.Operator[error], func(error) Result[T]) Result[T]
- func (ok OK[T]) Error(func(error) Result[T]) Result[T]
- func (ok OK[T]) If(operator op.Operator[T]) bool
- func (ok OK[T]) IfError(op.Operator[error]) bool
- func (ok OK[T]) Or(T) Result[T]
- func (ok OK[T]) String() string
- func (ok OK[T]) Then(call func(T) Result[T]) Result[T]
- func (ok OK[T]) TryError() error
- func (ok OK[T]) TryValue() T
- func (ok OK[T]) WhenError(func(error)) Result[T]
- func (ok OK[T]) WhenOK(call func(T)) Result[T]
- type Result
- type ResultIsErrorError
- type ResultIsOkError
- type Some
- func (some Some[T]) DoIf(comparator op.Operator[T], do func(T) Maybe[T]) Maybe[T]
- func (some Some[T]) Else(func() Maybe[T]) Maybe[T]
- func (some Some[T]) If(comparator op.Operator[T]) bool
- func (some Some[T]) Or(T) Maybe[T]
- func (some Some[T]) String() string
- func (some Some[T]) Then(call func(T) Maybe[T]) Maybe[T]
- func (some Some[T]) TryValue() T
- func (some Some[T]) WhenNothing(func()) Maybe[T]
- func (some Some[T]) WhenValue(call func(T)) Maybe[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Maybe ¶
type Maybe[T any] interface { Then(call func(T) Maybe[T]) Maybe[T] Else(call func() Maybe[T]) Maybe[T] WhenValue(call func(T)) Maybe[T] WhenNothing(call func()) Maybe[T] Or(value T) Maybe[T] If(comparator op.Operator[T]) bool DoIf(comparator op.Operator[T], do func(T) Maybe[T]) Maybe[T] TryValue() T // contains filtered or unexported methods }
type MaybeIsNothingError ¶
type MaybeIsNothingError struct {
// contains filtered or unexported fields
}
func NewMaybeIsNothingError ¶
func NewMaybeIsNothingError() MaybeIsNothingError
type Nothing ¶
type Nothing[T any] struct{}
func (Nothing[T]) WhenNothing ¶
type OK ¶
type OK[T any] struct { Value T }
type Result ¶
type Result[T any] interface { Then(call func(T) Result[T]) Result[T] Error(call func(error) Result[T]) Result[T] WhenOK(call func(T)) Result[T] WhenError(call func(error)) Result[T] Or(value T) Result[T] If(operator op.Operator[T]) bool DoIf(comparator op.Operator[T], do func(T) Result[T]) Result[T] IfError(operator op.Operator[error]) bool DoIfError(operator op.Operator[error], do func(error) Result[T]) Result[T] TryValue() T TryError() error // contains filtered or unexported methods }
type ResultIsErrorError ¶
type ResultIsErrorError struct {
Err error
// contains filtered or unexported fields
}
func NewResultIsErrorError ¶
func NewResultIsErrorError(err error) ResultIsErrorError
type ResultIsOkError ¶
type ResultIsOkError struct {
// contains filtered or unexported fields
}
func NewResultIsOkError ¶
func NewResultIsOkError() ResultIsOkError
Click to show internal directories.
Click to hide internal directories.