service

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SVC

type SVC struct {
	// contains filtered or unexported fields
}

SVC is the service layer, it provides API to access and manage the flows

func New

func New() *SVC

New create a service layer instance

func (*SVC) AddFlow

func (s *SVC) AddFlow(ctx context.Context, id nameid.ID, rd io.ReadCloser) error

AddFlow parse a flowl source file and add a flow instance into runtime

func (*SVC) CancelRunningFlow

func (s *SVC) CancelRunningFlow(ctx context.Context, id nameid.ID) error

CancelRunningFlow cancels a running flow, the canceled flow not be started again automatically.

func (*SVC) GetAvailableMeta

func (s *SVC) GetAvailableMeta(ctx context.Context, id nameid.ID) (exported.FlowMetaInsight, error)

GetAvailableMeta returns the meta of the flow with the flow id

func (*SVC) InsightFlow

func (s *SVC) InsightFlow(ctx context.Context, fid nameid.ID) (exported.FlowRunningInsight, error)

InsightFlow exports the statistics of the flow

func (*SVC) InspectStdFunction

func (s *SVC) InspectStdFunction(ctx context.Context, name string) exported.InspectStdFunction

InspectStdFunction returns the manifest of the standard function

func (*SVC) ListAvailables

func (s *SVC) ListAvailables(ctx context.Context) []exported.FlowMetaInsight

ListAvailables returns the list of all available flows in the flow source directory that be defined by the environment variable 'CO_FLOW_SOURCE_DIR'.

func (*SVC) ListStdFunctions

func (s *SVC) ListStdFunctions(ctx context.Context) []exported.ListStdFunctions

ListStdFunctions returns the list of the manifests of all standard functions.

func (*SVC) LookupID

func (s *SVC) LookupID(ctx context.Context, nameorid nameid.NameOrID) (nameid.ID, error)

LookupID be used to lookup 'nameid.ID' by the string of flow's id or name.

func (*SVC) ReadyFlow

func (s *SVC) ReadyFlow(ctx context.Context, id nameid.ID, out io.Writer) (exported.FlowRunningInsight, error)

ReadyFlow initialize the flow and make it ready to run

func (*SVC) StartEventFlow

func (s *SVC) StartEventFlow(ctx context.Context, id nameid.ID) chan error

StartEventFlow starts a flow with event triggers, it will run in a goroutine, so the invoking will return immediately.

func (*SVC) StartEventFlowAndWait

func (s *SVC) StartEventFlowAndWait(ctx context.Context, id nameid.ID) error

StartEventFlowAndWait starts a flow with event triggers and wait for it to be finished.

func (*SVC) StartFlow

func (s *SVC) StartFlow(ctx context.Context, id nameid.ID) chan error

StartFlow starts a flow without event triggers, it will return a channel that can be used to wait for the flow to be finished.

func (*SVC) StartFlowAndWait

func (s *SVC) StartFlowAndWait(ctx context.Context, id nameid.ID) error

StartFlowAndWait starts a flow without event triggers and wait for it to be finished.

func (*SVC) StartFlowOrEventFlow

func (s *SVC) StartFlowOrEventFlow(ctx context.Context, id nameid.ID) error

StartFlowOrEventFlow don't start the flows directly, it first start triggers of the flows, then execute the flows based on event from trigger. If not found any triggers of the flow, it will start the flow directly.

func (*SVC) ViewLog

func (s *SVC) ViewLog(ctx context.Context, id nameid.ID, seq int, w io.Writer) error

ViewLog be used to view the log of a flow or a function, the argument 'id' is the flow's id, the 'seq' is the sequence of the function, the 'w' argument is the output destination of the log.

type Writer

type Writer interface {
	JsonWrite(io.Writer) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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