Versions in this module Expand all Collapse all v1 v1.0.0 Feb 3, 2023 Changes in this version + var InvalidTypeErr = errors.New("promise.invalidType") + var MaxRetriesErr = errors.New("promise.maxRetries") + var TimeoutErr = errors.New("promise.timeout") + func Await(promise Promise) (V, error) + type CatchFunc func(err error) V + type ChainFunc func(promise Promise) Promise + func Catch(catch CatchFunc[V]) ChainFunc + func Then(then ThenFunc[V, W]) ChainFunc + type Errors []error + func (es Errors) Combine() error + func (es Errors) Error() string + type ExecuteFunc func(resolve ResolveFunc[V], reject RejectFunc) + type Promise interface + Reset func() + With func(chainFunc ChainFunc) Promise + func All(ps Promises) Promise + func AllSettled(ps Promises) Promise + func Any(ps Promises) Promise + func AsPreExecuted(promise Promise) Promise + func Function(fn PromiseFunc[V]) Promise + func New(executeFunc ExecuteFunc[V]) Promise + func Race(ps Promises) Promise + func Reject(err error) Promise + func Resolve(value V) Promise + func WithRetry(promise Promise, maxRetries int) Promise + func WithTimeout(promise Promise, duration time.Duration) Promise + type PromiseFunc func() (V, error) + type Promises []Promise + type RejectFunc func(err error) + type ResolveFunc func(value V) + type SettledResult struct + Error error + Value V + func (r SettledResult[V]) IsRejected() bool + func (r SettledResult[V]) IsResolved() bool + type SettledResults []SettledResult[V] + func (rs SettledResults[V]) Errors() Errors + func (rs SettledResults[V]) Values() []V + type ThenFunc func(value V) (W, error)