Documentation ¶
Index ¶
- Constants
- type Event
- type Flow
- func (f *Flow) AST() *parser.AST
- func (f *Flow) GetStatistics(seq int) *functionStatistics
- func (f *Flow) IsAdded() bool
- func (f *Flow) IsReady() bool
- func (f *Flow) IsRunning() bool
- func (f *Flow) IsStopped() bool
- func (f *Flow) Refresh() error
- func (f *Flow) RunQ() *actuator.RunQueue
- func (f *Flow) ToReady() error
- func (f *Flow) ToRunning()
- func (f *Flow) ToStopped()
- func (f *Flow) WithLock(exec func(body *FlowBody) error) error
- type FlowBody
- type FlowOption
- type Runtime
- func (rt *Runtime) CancelFlow(ctx context.Context, id nameid.ID) error
- func (rt *Runtime) DeleteFlow(ctx context.Context, id nameid.ID) error
- func (rt *Runtime) ExecFlow(ctx context.Context, id nameid.ID) (err0 error)
- func (rt *Runtime) FetchFlow(ctx context.Context, id nameid.ID, do func(*FlowBody) error) error
- func (rt *Runtime) HasTrigger(id nameid.ID) (bool, error)
- func (rt *Runtime) InitFlow(ctx context.Context, id nameid.ID, opts ...FlowOption) error
- func (rt *Runtime) MustReady(ctx context.Context, id nameid.ID) error
- func (rt *Runtime) ParseFlow(ctx context.Context, id nameid.ID, rd io.Reader) error
- func (rt *Runtime) StartEventTrigger(ctx context.Context, id nameid.ID) error
- func (rt *Runtime) Stopped2Ready(ctx context.Context, id nameid.ID) error
- type StatusType
Constants ¶
const ( StatusAdded = StatusType("ADDED") StatusReady = StatusType("READY") StatusRunning = StatusType("RUNNING") StatusStopped = StatusType("STOPPED") StatusKilled = StatusType("KILLED") StatusCanceled = StatusType("CANCELED") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event is from the event trigger, it will be used to make the flow run
type Flow ¶
Flow
func (*Flow) GetStatistics ¶
GetStatistics returns the statistics of the function node, 'seq' is the sequence id of the function node.
func (*Flow) Refresh ¶
Refresh figures out the status and statistics of the flow based on the function statistics.
func (*Flow) ToRunning ¶
func (f *Flow) ToRunning()
ToRunning set the flow to running status and the begin time of the last running
type FlowBody ¶
type FlowBody struct {
// contains filtered or unexported fields
}
func (*FlowBody) Export ¶
func (b *FlowBody) Export() exported.FlowRunningInsight
Export exports some statistics of the flow running to the service layer.
func (*FlowBody) SetCancel ¶
func (b *FlowBody) SetCancel(cancel context.CancelFunc)
SetCancel set the context cancel function to the flow.
type FlowOption ¶
type FlowOption func(*FlowBody)
func WithAfterFunc ¶
func WithAfterFunc(_func func(nameid.ID) error) FlowOption
WithAfterFunc initializes the after call-back.
func WithBeforeFunc ¶
func WithBeforeFunc(_func func(nameid.ID) error) FlowOption
WithBeforeFunc initializes the before call-back.
func WithCopyResources ¶
func WithCopyResources(copy func() resource.Resources) FlowOption
WithCopyResources initializes the resources of the flow & function.
func WithCreateLogwriter ¶
func WithCreateLogwriter(_func func(string) (io.Writer, error)) FlowOption
WithCreateLogwriter initializes the logger for flow & function write the log.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func (*Runtime) CancelFlow ¶
CancelFlow cancel the flow and make it into CANCELED status.
func (*Runtime) FetchFlow ¶
FetchFlow get a flow, then access or handle it safety by the callback function
func (*Runtime) HasTrigger ¶
HasTrigger check the flow has a trigger or not
func (*Runtime) ParseFlow ¶
ParseFlow parse one flowl source file, and add a flow into runtime, the argument 'rd' is a reader for a flow source file. After invoking this method, the flow's status is ADDED.
func (*Runtime) StartEventTrigger ¶
StartEventTrigger start the event trigger of a flow, every event trigger function will run in a goroutine When a event trigger returned without an error, will create and send a event to runtime
type StatusType ¶
type StatusType string