inherit

package
v0.37.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2021 License: GPL-2.0, GPL-3.0 Imports: 3 Imported by: 0

README

inherit - Arguments Propagator

The inherit middleware manages the propagation of arguments from parent to child pipes.

Arguments

It takes an array of string arguments, listing the arguments that should be inherited from the parent pipe.

Note that inheritance currently considers only a single level of nesting. A grandchild pipe will not inherit arguments from the grandparent, unless these are explicitly inherited by the parent as well. This behavior may change in a future version of pipedream.

private:
    some-pipe:
        argument-1: value-1
        argument-2: value-2
        argument-3: value-3
        pipe:
            - child-pipe:
                # in this case, the child pipe will inherit `argument-1`
                inherit:
                    - argument-1
                    - argument-3
                # the child's own arguments take precedence over inherited arguments
                # so `argument-3` with have value `other-value`, not `value-3`
                argument-3: other-value

Documentation

Overview

Package inherit provides a middleware that passes arguments from a parent to its children

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware added in v0.32.2

type Middleware struct {
}

Middleware is an arguments propagator

func NewMiddleware added in v0.32.2

func NewMiddleware() Middleware

NewMiddleware creates a new middleware instance

func (Middleware) Apply added in v0.32.2

func (inheritMiddleware Middleware) Apply(
	run *pipeline.Run,
	next func(*pipeline.Run),
	_ *middleware.ExecutionContext,
)

Apply is where the middleware's logic resides

It adapts the run based on its slice of the run's arguments. It may also trigger side effects such as executing shell commands or full runs of other pipelines. When done, this function should call next in order to continue unwinding the stack.

func (Middleware) String added in v0.32.2

func (Middleware) String() string

String is a human-readable description

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL