Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 8.2% on proxy.golang.org
Top 5.8% dependent packages on proxy.golang.org
Top 4.7% dependent repos on proxy.golang.org

proxy.golang.org : github.com/saantiaguilera/go-pipeline

The pipeline API allows us to create pipelines/workflows/templates were we can link different units of works (we will call them steps) between them to produce a graph of work. A step is a contract that allows us to represent or run a unit of work. A step requires an input and may return an output or an error depending on whether it failed or not. A step is declared as Steps are considered the backbone of the API. The API already provides a set of steps that should suffice to create any type of pipeline, but there may be specific scenarios were the given API gets too verbose or its not enough. In these type of scenarios we can create our own custom steps to match our needs. The steps provided by the API are: The most simple and atomic step. This step lets us run a single unit of work. A sequential step allows us to "link" two steps together sequentially. A concurrent step allows us to "link" multiple steps concurrently and once they're done reduce them to a single output. A conditional step allows us to evaluate a condition and depending on its result branch to specific step. This step allows us to branch the graph in two different branches. An optional step is similar to a conditional one, although it only has a single branch. It either runs the given Step or it skips it (returning the initial input), depending on the result of the statement evaluation. It also supports altering the output, but when doing so you need to provide how to default to it when the step is skipped Steps need to comply to an extremely simple interface. Hence, we can create our own custom steps by simply creating a struct that matches the given contract. There are no restrictions besides these two so it's highly flexible when wanting to create custom behaviors or logics. For example, a step that always succeeds and doesn't mutate the result might be: Running a pipeline is as simple as running the final step. You will need a context of your own (steps are context aware) and an initial input so the graph can be traversed with it and mutate it to yield a final output. You can render a graph by simply creating a graph and drawing the steps on it Eg. for rendering an UML you should do Example basic showcases a simple graph that uses the basic API steps to produce a simple result based on a given input. The input will be mutated across different steps (incrementing or doubling it) and finally, print if it's a 3 digit number or not For showing purposes, all steps and pipeline building are in the same function and use basic parameter types and logics (we don't showcase a real life usecase with infrastructure / http calls / etc), just note that it's quite similar. In the examples directory you can find more elaborate samples on how to do this better. Example complex showcases a complex graph that uses most of the API steps to produce a simple result based on a given input. The input will be mutated across different steps (incrementing or doubling it) and finally, print if it's a 3 digit number or not For showing purposes, all steps and pipeline building are in the same function and use basic parameter types and logics (we don't showcase a real life usecase with infrastructure / http calls / etc), just note that it's quite similar. In the examples directory you can find more elaborate samples on how to do this better.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/saantiaguilera/go-pipeline
Keywords: faas-flow, flow, flow-control, flowframework, pipeline, pipeline-framework, pipeline-processor, template, template-library, workflow
License: GPL-3.0
Latest release: about 2 years ago
First release: over 4 years ago
Namespace: github.com/saantiaguilera
Dependent packages: 1
Dependent repositories: 1
Stars: 16 on GitHub
Forks: 1 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 17 days ago

    Loading...
    Readme
    Loading...