Documentation
¶
Index ¶
- func SwaggerDoc(baseurl string, wfName string, wf func() async.WorkflowState) (interface{}, error)
- type Config
- type DBWorkflow
- type DBWorkflowLog
- type FirestoreEngine
- func (fs FirestoreEngine) Get(ctx context.Context, id string) (*DBWorkflow, error)
- func (fs FirestoreEngine) HandleCallback(ctx context.Context, id string, cb async.CallbackRequest, input interface{}) (interface{}, error)
- func (fs FirestoreEngine) HandleEvent(ctx context.Context, id string, name string, input interface{}) (interface{}, error)
- func (fs FirestoreEngine) Lock(ctx context.Context, id string) (DBWorkflow, error)
- func (fs FirestoreEngine) Resume(ctx context.Context, id string) error
- func (fs FirestoreEngine) Save(ctx context.Context, wf *DBWorkflow, s *async.WorkflowState, unlock bool) error
- func (fs FirestoreEngine) ScheduleAndCreate(ctx context.Context, id, name string, state interface{}) error
- func (fs FirestoreEngine) Unlock(ctx context.Context, id string) error
- type GTasksScheduler
- func (mgr *GTasksScheduler) ResumeHandler(w http.ResponseWriter, r *http.Request)
- func (mgr *GTasksScheduler) Schedule(ctx context.Context, id string, delay time.Duration) error
- func (mgr *GTasksScheduler) Setup(ctx context.Context, r async.CallbackRequest, del time.Duration) (string, error)
- func (mgr *GTasksScheduler) Teardown(ctx context.Context, req async.CallbackRequest, handled bool) error
- func (mgr *GTasksScheduler) TimeoutHandler(w http.ResponseWriter, r *http.Request)
- type GTasksSchedulerData
- type GraphCtx
- type Grapher
- type ResumeRequest
- type Server
- type TimeoutHandler
- func (t *TimeoutHandler) Handle(ctx context.Context, req async.CallbackRequest, input interface{}) (interface{}, error)
- func (s TimeoutHandler) MarshalJSON() ([]byte, error)
- func (t *TimeoutHandler) Setup(ctx context.Context, req async.CallbackRequest) (string, error)
- func (t *TimeoutHandler) Teardown(ctx context.Context, req async.CallbackRequest, handled bool) error
- type TimeoutReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SwaggerDoc ¶ added in v0.1.4
func SwaggerDoc(baseurl string, wfName string, wf func() async.WorkflowState) (interface{}, error)
Types ¶
type DBWorkflow ¶
type DBWorkflowLog ¶
type FirestoreEngine ¶
type FirestoreEngine struct { Scheduler *GTasksScheduler DB *firestore.Client Collection string Workflows map[string]func() async.WorkflowState }
func (FirestoreEngine) Get ¶
func (fs FirestoreEngine) Get(ctx context.Context, id string) (*DBWorkflow, error)
func (FirestoreEngine) HandleCallback ¶
func (fs FirestoreEngine) HandleCallback(ctx context.Context, id string, cb async.CallbackRequest, input interface{}) (interface{}, error)
func (FirestoreEngine) HandleEvent ¶
func (FirestoreEngine) Lock ¶
func (fs FirestoreEngine) Lock(ctx context.Context, id string) (DBWorkflow, error)
func (FirestoreEngine) Resume ¶
func (fs FirestoreEngine) Resume(ctx context.Context, id string) error
func (FirestoreEngine) Save ¶ added in v0.1.6
func (fs FirestoreEngine) Save(ctx context.Context, wf *DBWorkflow, s *async.WorkflowState, unlock bool) error
func (FirestoreEngine) ScheduleAndCreate ¶
func (fs FirestoreEngine) ScheduleAndCreate(ctx context.Context, id, name string, state interface{}) error
type GTasksScheduler ¶
type GTasksScheduler struct { Engine *FirestoreEngine C *cloudtasks.Service Collection string ProjectID string LocationID string QueueName string ResumeURL string CallbackURL string Secret string }
func (*GTasksScheduler) ResumeHandler ¶
func (mgr *GTasksScheduler) ResumeHandler(w http.ResponseWriter, r *http.Request)
func (*GTasksScheduler) Schedule ¶
in this demo we resume workflows right inside the http handler. we use this scheduler only for redundancy in case resume will fail for some reason in http handler.
func (*GTasksScheduler) Setup ¶
func (mgr *GTasksScheduler) Setup(ctx context.Context, r async.CallbackRequest, del time.Duration) (string, error)
func (*GTasksScheduler) Teardown ¶
func (mgr *GTasksScheduler) Teardown(ctx context.Context, req async.CallbackRequest, handled bool) error
func (*GTasksScheduler) TimeoutHandler ¶
func (mgr *GTasksScheduler) TimeoutHandler(w http.ResponseWriter, r *http.Request)
type GTasksSchedulerData ¶
type GTasksSchedulerData struct {
ID string
}
type ResumeRequest ¶
func (ResumeRequest) HMAC ¶ added in v0.1.2
func (req ResumeRequest) HMAC(secret []byte) string
type Server ¶
type Server struct { Router *mux.Router Engine *FirestoreEngine Scheduler *GTasksScheduler }
type TimeoutHandler ¶
func (*TimeoutHandler) Handle ¶
func (t *TimeoutHandler) Handle(ctx context.Context, req async.CallbackRequest, input interface{}) (interface{}, error)
func (TimeoutHandler) MarshalJSON ¶
func (s TimeoutHandler) MarshalJSON() ([]byte, error)
func (*TimeoutHandler) Setup ¶
func (t *TimeoutHandler) Setup(ctx context.Context, req async.CallbackRequest) (string, error)
func (*TimeoutHandler) Teardown ¶
func (t *TimeoutHandler) Teardown(ctx context.Context, req async.CallbackRequest, handled bool) error
type TimeoutReq ¶ added in v0.1.2
type TimeoutReq struct { Req async.CallbackRequest Signature string }
func (TimeoutReq) HMAC ¶ added in v0.1.2
func (req TimeoutReq) HMAC(secret []byte) string
Click to show internal directories.
Click to hide internal directories.