Documentation ¶
Index ¶
- Constants
- type FlowTesterFactory
- type RequestProcessor
- func (rp *RequestProcessor) RestartFlow(restartRequest *RestartRequest) (results map[string]interface{}, err error)
- func (rp *RequestProcessor) ResumeFlow(resumeRequest *ResumeRequest) (results map[string]interface{}, err error)
- func (rp *RequestProcessor) StartFlow(startRequest *StartRequest) (results map[string]interface{}, err error)
- type RestFlowTester
- func (ft *RestFlowTester) Name() string
- func (ft *RestFlowTester) RestartFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (ft *RestFlowTester) ResumeFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (ft *RestFlowTester) Start() error
- func (ft *RestFlowTester) StartFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (ft *RestFlowTester) Status(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (ft *RestFlowTester) Stop() error
- type RestartRequest
- type ResumeRequest
- type Server
- type StartRequest
Constants ¶
const (
RefFlow = "github.com/AiRISTAFlowInc/FSFlow"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestProcessor ¶
type RequestProcessor struct {
// contains filtered or unexported fields
}
RequestProcessor processes request objects and invokes the corresponding flow Manager methods
func NewRequestProcessor ¶
func NewRequestProcessor() *RequestProcessor
NewRequestProcessor creates a new RequestProcessor
func (*RequestProcessor) RestartFlow ¶
func (rp *RequestProcessor) RestartFlow(restartRequest *RestartRequest) (results map[string]interface{}, err error)
RestartFlow handles a RestartRequest for a FlowInstance. This will generate an ID for the new FlowInstance and queue a RestartRequest.
func (*RequestProcessor) ResumeFlow ¶
func (rp *RequestProcessor) ResumeFlow(resumeRequest *ResumeRequest) (results map[string]interface{}, err error)
ResumeFlow handles a ResumeRequest for a FlowInstance. This will queue a RestartRequest.
func (*RequestProcessor) StartFlow ¶
func (rp *RequestProcessor) StartFlow(startRequest *StartRequest) (results map[string]interface{}, err error)
StartFlow handles a StartRequest for a FlowInstance. This will generate an ID for the new FlowInstance and queue a StartRequest.
type RestFlowTester ¶
type RestFlowTester struct {
// contains filtered or unexported fields
}
RestFlowTester is default REST implementation of the EngineTester
func (*RestFlowTester) Name ¶
func (ft *RestFlowTester) Name() string
func (*RestFlowTester) RestartFlow ¶
func (ft *RestFlowTester) RestartFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
RestartFlow restarts a Flow Instance (POST "/flow/restart").
To post a restart flow, try this at a shell: $ curl -H "Content-Type: application/json" -X POST -d '{...}' http://localhost:8080/flow/restart
func (*RestFlowTester) ResumeFlow ¶
func (ft *RestFlowTester) ResumeFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
ResumeFlow resumes a Flow Instance (POST "/flow/resume").
To post a resume flow, try this at a shell: $ curl -H "Content-Type: application/json" -X POST -d '{...}' http://localhost:8080/flow/resume
func (*RestFlowTester) Start ¶
func (ft *RestFlowTester) Start() error
Start implements engine.EngineTester.Start
func (*RestFlowTester) StartFlow ¶
func (ft *RestFlowTester) StartFlow(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
StartFlow starts a new Flow Instance (POST "/flow/start").
To post a start flow, try this at a shell: $ curl -H "Content-Type: application/json" -X POST -d '{"flowUri":"base"}' http://localhost:8080/flow/start
func (*RestFlowTester) Status ¶
func (ft *RestFlowTester) Status(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Status is a basic health check for the server to determine if it is up
func (*RestFlowTester) Stop ¶
func (ft *RestFlowTester) Stop() error
Stop implements engine.EngineTester.Stop
type RestartRequest ¶
type RestartRequest struct { InitialState *instance.IndependentInstance `json:"initialState"` Data map[string]interface{} `json:"data"` Interceptor *support.Interceptor `json:"interceptor"` Patch *support.Patch `json:"patch"` }
RestartRequest describes a request for restarting a FlowInstance todo: can be merged into StartRequest
type ResumeRequest ¶
type ResumeRequest struct { State *instance.IndependentInstance `json:"state"` Data map[string]interface{} `json:"data"` Interceptor *support.Interceptor `json:"interceptor"` Patch *support.Patch `json:"patch"` }
ResumeRequest describes a request for resuming a FlowInstance todo: Data for resume request should be directed to waiting task
type Server ¶
Server the server structure
func NewServer ¶
NewServer creates a new server instance param server - is a instance of http.Server, can be nil and a default one will be created
func (*Server) InstanceID ¶
InstanceID is the server instance ID
func (*Server) IsStarted ¶
IsStarted checks if the server is started note: will return true even if the server is stopped but there are still some requests to finish
type StartRequest ¶
type StartRequest struct { FlowURI string `json:"flowUri"` Data map[string]interface{} `json:"data"` Attrs map[string]interface{} `json:"attrs"` Interceptor *support.Interceptor `json:"interceptor"` Patch *support.Patch `json:"patch"` ReplyTo string `json:"replyTo"` }
StartRequest describes a request for starting a FlowInstance