runtime

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 25 Imported by: 3

Documentation

Index

Constants

View Source
const (
	InternalRequestQueueInitial = "goflow-internal-request"
	FlowKeyInitial              = "goflow-flow"
	WorkerKeyInitial            = "goflow-worker"

	GoFlowRegisterInterval = 4
	RDBKeyTimeOut          = 10

	PartialRequest = "PARTIAL"
	NewRequest     = "NEW"
	PauseRequest   = "PAUSE"
	ResumeRequest  = "RESUME"
	StopRequest    = "STOP"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FlowDefinitionHandler

type FlowDefinitionHandler func(flow *v1.Workflow, context *v1.Context) error

type FlowExecutor

type FlowExecutor struct {
	CallbackURL             string // the callback url
	RequestAuthSharedSecret string
	RequestAuthEnabled      bool
	EnableMonitoring        bool
	IsLoggingEnabled        bool

	StateStore   sdk.StateStore
	DataStore    sdk.DataStore
	EventHandler sdk.EventHandler
	Logger       sdk.Logger
	Handler      FlowDefinitionHandler
	Runtime      *FlowRuntime
	// contains filtered or unexported fields
}

func (*FlowExecutor) Configure

func (fe *FlowExecutor) Configure(requestID string)

func (*FlowExecutor) GetDataStore

func (fe *FlowExecutor) GetDataStore() (sdk.DataStore, error)

func (*FlowExecutor) GetEventHandler

func (fe *FlowExecutor) GetEventHandler() (sdk.EventHandler, error)

func (*FlowExecutor) GetExecutionOption

func (fe *FlowExecutor) GetExecutionOption(_ sdk.Operation) map[string]interface{}

func (*FlowExecutor) GetFlowDefinition

func (fe *FlowExecutor) GetFlowDefinition(pipeline *sdk.Pipeline, context *sdk.Context) error

func (*FlowExecutor) GetFlowName

func (fe *FlowExecutor) GetFlowName() string

func (*FlowExecutor) GetLogger

func (fe *FlowExecutor) GetLogger() (sdk.Logger, error)

func (*FlowExecutor) GetReqAuthKey

func (fe *FlowExecutor) GetReqAuthKey() (string, error)

func (*FlowExecutor) GetStateStore

func (fe *FlowExecutor) GetStateStore() (sdk.StateStore, error)

func (*FlowExecutor) GetValidationKey

func (fe *FlowExecutor) GetValidationKey() (string, error)

func (*FlowExecutor) HandleExecutionCompletion

func (fe *FlowExecutor) HandleExecutionCompletion(data []byte) error

func (*FlowExecutor) HandleNextNode

func (fe *FlowExecutor) HandleNextNode(partial *executor.PartialState) error

func (*FlowExecutor) Init

func (fe *FlowExecutor) Init(request *runtime.Request) error

func (*FlowExecutor) LoggingEnabled

func (fe *FlowExecutor) LoggingEnabled() bool

func (*FlowExecutor) MonitoringEnabled

func (fe *FlowExecutor) MonitoringEnabled() bool

func (*FlowExecutor) ReqAuthEnabled

func (fe *FlowExecutor) ReqAuthEnabled() bool

func (*FlowExecutor) ReqValidationEnabled

func (fe *FlowExecutor) ReqValidationEnabled() bool

type FlowRuntime

type FlowRuntime struct {
	Flows          map[string]FlowDefinitionHandler
	OpenTracingUrl string
	RedisURL       string

	DataStore               sdk.DataStore
	Logger                  sdk.Logger
	Concurrency             int
	ServerPort              int
	ReadTimeout             time.Duration
	WriteTimeout            time.Duration
	RequestAuthSharedSecret string
	RequestAuthEnabled      bool
	EnableMonitoring        bool
	RetryQueueCount         int
	DebugEnabled            bool
	// contains filtered or unexported fields
}

func (*FlowRuntime) Consume added in v0.1.1

func (fRuntime *FlowRuntime) Consume(message rmq.Delivery)

Consume messages from queue

func (*FlowRuntime) CreateExecutor

func (fRuntime *FlowRuntime) CreateExecutor(req *runtime.Request) (executor.Executor, error)

func (*FlowRuntime) EnqueuePartialRequest

func (fRuntime *FlowRuntime) EnqueuePartialRequest(pr *runtime.Request) error

func (*FlowRuntime) Execute

func (fRuntime *FlowRuntime) Execute(flowName string, request *runtime.Request) error

func (*FlowRuntime) Init

func (fRuntime *FlowRuntime) Init() error

func (*FlowRuntime) Pause added in v0.1.0

func (fRuntime *FlowRuntime) Pause(flowName string, request *runtime.Request) error

func (*FlowRuntime) Resume added in v0.1.0

func (fRuntime *FlowRuntime) Resume(flowName string, request *runtime.Request) error

func (*FlowRuntime) StartQueueWorker

func (fRuntime *FlowRuntime) StartQueueWorker(errorChan chan error) error

StartQueueWorker starts listening for request in queue

func (*FlowRuntime) StartRuntime added in v0.1.0

func (fRuntime *FlowRuntime) StartRuntime() error

StartRuntime starts the runtime

func (*FlowRuntime) StartServer

func (fRuntime *FlowRuntime) StartServer() error

StartServer starts listening for new request

func (*FlowRuntime) Stop added in v0.1.0

func (fRuntime *FlowRuntime) Stop(flowName string, request *runtime.Request) error

func (*FlowRuntime) StopServer added in v0.0.8

func (fRuntime *FlowRuntime) StopServer() error

StopServer stops the server

type Task added in v0.1.1

type Task struct {
	FlowName    string              `json:"flow_name"`
	RequestID   string              `json:"request_id"`
	Body        string              `json:"body"`
	Header      map[string][]string `json:"header"`
	RawQuery    string              `json:"raw_query"`
	Query       map[string][]string `json:"query"`
	RequestType string              `json:"request_type"`
}

type Worker added in v0.1.0

type Worker struct {
	ID          string   `json:"id"`
	Flows       []string `json:"flows"`
	Concurrency int      `json:"concurrency"`
}

Jump to

Keyboard shortcuts

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