Documentation
¶
Index ¶
- func From[A any](in awsevents.IEventBus) duct.Morphism[A, A]
- func Join[A, B, C any](_ func(context.Context, B) (C, error), f awslambda.IFunction, ...) duct.Morphism[A, C]
- func Lift[A, B, C any](_ func(context.Context, B) (C, error), f awslambda.IFunction, ...) duct.Morphism[A, C]
- func LiftP[A, B, C any](n int, _ func(context.Context, B) (C, error), f awslambda.IFunction, ...) duct.Morphism[A, C]
- func StateMachine[A, B any](ts TypeStep, m duct.Morphism[A, B])
- func ToEventBus[A, B any](source string, bus awsevents.IEventBus, m duct.Morphism[A, B]) duct.Morphism[A, duct.Void]
- func ToQueue[A, B any](q awssqs.IQueue, m duct.Morphism[A, B]) duct.Morphism[A, duct.Void]
- func Unit[A, B any](m duct.Morphism[A, B]) duct.Morphism[A, []B]
- func Wrap[A, B any](m duct.Morphism[A, []B]) duct.Morphism[A, B]
- type TypeStep
- type TypeStepProps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Join ¶
func Join[A, B, C any]( _ func(context.Context, B) (C, error), f awslambda.IFunction, m duct.Morphism[A, B], ) duct.Morphism[A, C]
Compose lambda function transformer 𝑓: B ⟼ C with morphism 𝑚: A ⟼ B producing a new morphism 𝑚: A ⟼ C.
func Lift ¶
func Lift[A, B, C any]( _ func(context.Context, B) (C, error), f awslambda.IFunction, m duct.Morphism[A, []B], ) duct.Morphism[A, C]
Compose lambda function transformer 𝑓: B ⟼ C with morphism 𝑚: A ⟼ []B. It produces a new computation 𝑚: A ⟼ []C that enables transformation within `[]C` context without immediate collapsing (see duct.LiftF for details). In other words, it nests the computation within the slice context. It is a responsibility of lifter to do something with those nested contexts either yielding individual elements or uniting (e.g. use Unit(Join(g, Lift(f))) to leave nested context into the morphism 𝑚: A ⟼ []C).
func LiftP ¶
func LiftP[A, B, C any]( n int, _ func(context.Context, B) (C, error), f awslambda.IFunction, m duct.Morphism[A, []B], ) duct.Morphism[A, C]
See Lift for details. The function LiftP is equivalent to Lift but allows to specify the maximum number of concurrent invocations of the lambda function.
func StateMachine ¶
StateMachine injects the morphism into the AWS Step Function, it constructs the state machine from the defined computation.
func ToEventBus ¶
func ToEventBus[A, B any](source string, bus awsevents.IEventBus, m duct.Morphism[A, B]) duct.Morphism[A, duct.Void]
Yield results of 𝑚: A ⟼ B binding it with AWS EventBridge.
func Unit ¶
Unit finalizes a transformation context by collapsing the nested morphism. It acts as the terminal operation, ensuring that all staged compositions, such as those built with Lift and Wrap, are fully resolved into a single, consumable form.
Types ¶
type TypeStep ¶
type TypeStep interface {
constructs.IConstruct
}
TypeStep is AWS CDK L3, a builder for AWS Step Function state machine.
func NewTypeStep ¶
func NewTypeStep(scope constructs.Construct, id *string, props *TypeStepProps) TypeStep
Create a new instance of TypeStep construct
type TypeStepProps ¶
type TypeStepProps struct {
// DeadLetterQueue is the queue to receive messages to if an error occurs
// while running the computation. The message is input JSON and "error".
DeadLetterQueue awssqs.IQueue
// SeqConcurrency is the maximum number of lambda's invocations allowed for
// itterators while processing the sequence of computations (morphism 𝑚: A ⟼ []B).
SeqConcurrency *float64
}
TypeStep L3 construct properties