Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMissingClientAPIKey = errors.Newf("missing client settings api key")
View Source
var ErrMissingClientSettings = errors.Newf("missing client settings")
Functions ¶
This section is empty.
Types ¶
type Step ¶
type Step[T any, U any] interface { // Start gets called multiple times for the same Step, once per incoming value, // since StepResult is also the list monad (ie., supports multiple values) Start(ctx context.Context, input T) (StepResult[U], error) }
Step is the generalization of a lambda function, with cancellation and closing to allow it to own resources.
type StepResult ¶ added in v0.2.4
type StepResult[T any] interface { Return() []helpers.Result[T] GetChannel() <-chan helpers.Result[T] }
func Bind ¶ added in v0.2.4
func Bind[T any, U any]( ctx context.Context, m StepResult[T], step Step[T, U], ) StepResult[U]
Bind is the monadic bind operator for StepResult. It takes a step result, a step (which is just a lambda turned into a struct) iterates over the results in the StepResult, and starts the Step for each value.
type StepResultImpl ¶ added in v0.2.24
type StepResultImpl[T any] struct { // contains filtered or unexported fields }
func NewStepResult ¶ added in v0.2.4
func NewStepResult[T any](value <-chan helpers.Result[T]) *StepResultImpl[T]
func Reject ¶ added in v0.2.4
func Reject[T any](err error) *StepResultImpl[T]
func Resolve ¶ added in v0.2.4
func Resolve[T any](value T) *StepResultImpl[T]
func ResolveNone ¶ added in v0.2.4
func ResolveNone[T any]() *StepResultImpl[T]
func (*StepResultImpl[T]) GetChannel ¶ added in v0.2.24
func (m *StepResultImpl[T]) GetChannel() <-chan helpers.Result[T]
func (*StepResultImpl[T]) Return ¶ added in v0.2.24
func (m *StepResultImpl[T]) Return() []helpers.Result[T]
Click to show internal directories.
Click to hide internal directories.