oi

package module
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 9 Imported by: 0

README

Open Integration - a pipeline execution engine

Go Report Card codecov

asciicast

Install

Homebrew

brew tap open-integration/oi brew install oictl

Linux and Win

Use the released binaries

Til the project has not reached version > 1.x.x it may have breaking changes in the API, please use the latest version before opening issue.

Concepts

  • A compiled, binary pipeline
  • State - the engine holds the state of all the tasks
  • Service - a standalone binary exposing API over http2 (gRPC) that the engine can trigger, called endpoint.
    • Endpoint of a service defined by 2 files of JSON schema, arguments.json and returns.json, the engine will enforce the arguments given by a task and the output created to match the schema.
  • Task - execution flow with input and output.
    • Service Task will send a request to service based on the endpoint.

Architecture

Diagram

Dataflow

Diagram

Example

use oictl to generate hello-world pipeline

  • ioctl generate pipeline
  • go run *.go
Real world examples

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConditionCombined

func ConditionCombined(conditions ...condition.Condition) condition.Condition

ConditionCombined returns the condition that is evaluated to true when all the conditions are true

func ConditionEngineStarted

func ConditionEngineStarted() condition.Condition

ConditionEngineStarted returns the condition that is evaluated to true on engine.started event

func ConditionTaskEventReported

func ConditionTaskEventReported(name string) condition.Condition

ConditionTaskEventReported return the condition that satisfied when task reported event in format {TASK_NAME}.{EVENT}

func ConditionTaskFinished

func ConditionTaskFinished(task string) condition.Condition

ConditionTaskFinished returns the condition that is evaluated to true on task.finished event and the task is marked as finished in the state

func ConditionTaskFinishedWithStatus

func ConditionTaskFinishedWithStatus(task string, status string) condition.Condition

ConditionTaskFinishedWithStatus returns the condition that is evaluated to true on task.finished event and the task is marked as finished in the state and the status is as given

func HandleEngineError

func HandleEngineError(err error)

HandleEngineError prints the error in case the engine.Run was failed and exit

func NewEngine

func NewEngine(opt *EngineOptions) engine.Engine

NewEngine create new engine

func NewFunctionTask

func NewFunctionTask(name string, fn func(context.Context, task.RunOptions) ([]byte, error)) task.Task

NewFunctionTask build task that will be executed in same process

func NewSerivceTask

func NewSerivceTask(name string, service string, endpoint string, arg ...task.Argument) task.Task

NewSerivceTask build task task calls a service with arguments

func NewTickerTask

func NewTickerTask(name string, tickInterval time.Duration, totalTime time.Duration) task.Task

NewTickerTask builds task that will send event every tickInterval till it stops on totalTime

Types

type EngineOptions

type EngineOptions struct {
	Pipeline engine.Pipeline
	// LogsDirectory path where to store logs
	LogsDirectory string
	Kubeconfig    *engine.KubernetesOptions
	Logger        logger.Logger
}

EngineOptions to create new engine

Jump to

Keyboard shortcuts

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