AFAIRE
sdk
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.0 KiB

/*
------------------------------------------------------------------------------------------------------------------------
####### sdk ####### Copyright (c) 2021-2022 losyme ################################################# MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package sdk
import (
"time"
"forge.chapril.org/dune/jw"
)
type Model interface {
CreateJob(job *jw.Job) (*jw.Job, error)
NextJob(namespace string) (*jw.Job, error)
UpdateJob(job *jw.Job) (*jw.Job, error)
CreateWorkflow(wf *jw.Workflow) (*jw.Workflow, error)
}
type Runner interface {
Namespace() string
Run(job *jw.Job) error
}
type StorageEvent struct {
Type string `bson:"type"`
Timestamp time.Time `bson:"timestamp"`
Job string `bson:"job"`
Workflow string `bson:"workflow"`
Data interface{} `bson:"data"`
}
/*
######################################################################################################## @(°_°)@ #######
*/