Documentation ¶
Index ¶
- func Bool2ef(ok bool, ng func() error) func() error
- func Bool2error(ok bool, ng func() error) error
- func CoalesceError(e1 error, e2 error) error
- func Compose[T, U, V any](f func(T) U, g func(U) V) func(T) V
- func ComposeEither[T, U, V, E any](f func(T) Either[U, E], g func(U) Either[V, E]) func(T) Either[V, E]
- func Curry[T, U, V any](f func(T, U) V) func(T) func(U) V
- func Error1st(ef []func() error) error
- func Identity[T any](t T) T
- func IterAll[T any](i Iter[T], f func(T) bool) bool
- func IterReduce[T, U any](i Iter[T], init U, reducer func(U, T) U) U
- func IterReduceFilter[T, U any](i Iter[T], init U, filter func(T) bool, reducer func(U, T) U) U
- func NonAtomicUpsertBuilder(sel Select) func(Delete) func(Insert) Upsert
- func OptionEq[T comparable](o Option[T], other T) bool
- func OptionEqOpt[T comparable](o Option[T], other Option[T]) bool
- type Bucket
- type BucketItem
- type BulkUpsert
- type Create
- type Delete
- type Either
- func EitherFlatMap[T, U, E any](r Either[T, E], f func(T) Either[U, E]) Either[U, E]
- func EitherLeft[T, E any](e E) Either[T, E]
- func EitherMap[T, U, E any](r Either[T, E], f func(T) U) Either[U, E]
- func EitherNew[T any](t T, e error) Either[T, error]
- func EitherNg[T any](e error) Either[T, error]
- func EitherOk[T any](t T) Either[T, error]
- func EitherOkWhen[T, E any](e Either[T, E], okf func(E) (ok bool)) Either[Option[T], E]
- func EitherRight[T, E any](t T) Either[T, E]
- func IterTryCollect[T any](i Iter[Either[Option[T], error]]) Either[[]T, error]
- type Insert
- type Iter
- type IterFilter
- type Key
- type Option
- func MapGet[T comparable, U any](m map[T]U, t T) Option[U]
- func OptionEmpty[T any]() Option[T]
- func OptionFlatMap[T, U any](o Option[T], f func(T) Option[U]) Option[U]
- func OptionFromArray[T any](a []T, ix int) Option[T]
- func OptionFromBool[T any](b bool, f func() T) Option[T]
- func OptionMap[T, U any](o Option[T], f func(T) U) Option[U]
- func OptionNew[T any](t T) Option[T]
- func (o Option[T]) Empty() bool
- func (o Option[T]) Filter(flt func(T) bool) Option[T]
- func (o Option[T]) ForEach(f func(T))
- func (o Option[T]) HasValue() bool
- func (o Option[T]) Map(f func(T) T) Option[T]
- func (o Option[T]) Must() T
- func (o Option[T]) OkOrElse(ng func() error) Either[T, error]
- func (o Option[T]) UnwrapOr(t T) T
- func (o Option[T]) UnwrapOrElse(f func() T) T
- func (o Option[T]) Value() T
- type Select
- type Upsert
- type Val
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool2error ¶
func CoalesceError ¶
func ComposeEither ¶
func IterReduce ¶
func IterReduceFilter ¶
func NonAtomicUpsertBuilder ¶
func OptionEq ¶
func OptionEq[T comparable](o Option[T], other T) bool
func OptionEqOpt ¶
func OptionEqOpt[T comparable](o Option[T], other Option[T]) bool
Types ¶
type BucketItem ¶
type BucketItem struct {
// contains filtered or unexported fields
}
func BucketItemNew ¶
func BucketItemNew(key Key, val Val) BucketItem
func (BucketItem) Key ¶
func (b BucketItem) Key() Key
func (BucketItem) Val ¶
func (b BucketItem) Val() Val
type BulkUpsert ¶
BulkUpsert upserts items into single bucket.
type Either ¶
type Either[T, E any] interface { IsOk() bool IsNg() bool TryForEach(f func(T) E) E Ok() Option[T] UnwrapOrElse(func(E) T) T Left() Option[E] Right() Option[T] FlatMap(func(T) Either[T, E]) Either[T, E] Map(func(T) T) Either[T, E] }
func EitherFlatMap ¶
func EitherLeft ¶
func EitherOkWhen ¶
func EitherRight ¶
type IterFilter ¶
func IterFilterDefaultNew ¶
func IterFilterDefaultNew[T any]() IterFilter[T]
type Option ¶
type Option[T any] struct { // contains filtered or unexported fields }
func MapGet ¶
func MapGet[T comparable, U any](m map[T]U, t T) Option[U]
func OptionEmpty ¶
func OptionFromArray ¶
func OptionFromBool ¶
func (Option[T]) UnwrapOrElse ¶
func (o Option[T]) UnwrapOrElse(f func() T) T
Source Files ¶
Click to show internal directories.
Click to hide internal directories.