Documentation ¶
Index ¶
- Constants
- Variables
- func Main(serverURL, topic string, maxJobSize int, workerName string, workerPort int) error
- type Client
- func (c *Client) ReportJob(ctx context.Context, req *pb.ReportJobRequest) (res *pb.ReportJobResponse, err error)
- func (c *Client) ReportJobDone(ctx context.Context, req *pb.ReportJobDoneRequest) (res *pb.ReportJobDoneResponse, err error)
- func (c *Client) SubscribeJob(ctx context.Context, req *pb.SubscribeJobRequest) (res *pb.SubscribeJobResponse, err error)
- type Job
- type JobMessage
- type JobTask
- type Task
- type TaskRunFilter
- type TaskRunner
- type Tasks
- type Worker
Constants ¶
View Source
const ( EQ = iota NOTEQ )
View Source
const ( HTTP_GET = "GET" HTTP_POST = "POST" )
View Source
const ( TASK_STATE_INIT = "INIT" TASK_STATE_PROCESS = "PROCESS" TASK_STATE_DONE = "DONE" TASK_STATE_CANCEL = "CANCEL" TASK_STATE_ERROR = "ERROR" TASK_EVENT_RUN = "run" TASK_EVENT_SUCCESS = "success" TASK_EVENT_CANCEL = "cancel" TASK_EVENT_ERROR = "error" TASK_QUIT = "quit" )
Variables ¶
View Source
var (
HTTPMethodNotSupport = errors.New("Http method is not supported")
)
View Source
var OPERATORS = []string{"==", "!="}
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ReportJob ¶
func (c *Client) ReportJob(ctx context.Context, req *pb.ReportJobRequest) (res *pb.ReportJobResponse, err error)
func (*Client) ReportJobDone ¶
func (c *Client) ReportJobDone(ctx context.Context, req *pb.ReportJobDoneRequest) (res *pb.ReportJobDoneResponse, err error)
func (*Client) SubscribeJob ¶
func (c *Client) SubscribeJob(ctx context.Context, req *pb.SubscribeJobRequest) (res *pb.SubscribeJobResponse, err error)
type Job ¶
func (*Job) OnTaskChanged ¶
func (job *Job) OnTaskChanged(tr *TaskRunner)
func (*Job) OnTaskDone ¶
func (job *Job) OnTaskDone(tr *TaskRunner)
func (*Job) OnTaskStateChange ¶
type JobMessage ¶
type JobTask ¶
func NewJobTask ¶
type TaskRunFilter ¶
type TaskRunFilter struct{}
func (*TaskRunFilter) Name ¶
func (f *TaskRunFilter) Name() string
type TaskRunner ¶
type TaskRunner struct {
// contains filtered or unexported fields
}
func NewTaskRunner ¶
func NewTaskRunner(job *Job, task *config.Task, templateCtx map[string]interface{}) *TaskRunner
func (*TaskRunner) Cancel ¶
func (tr *TaskRunner) Cancel()
func (*TaskRunner) Err ¶
func (tr *TaskRunner) Err() error
func (*TaskRunner) Ok ¶
func (tr *TaskRunner) Ok() bool
func (*TaskRunner) Output ¶
func (tr *TaskRunner) Output() string
func (*TaskRunner) Run ¶
func (tr *TaskRunner) Run()
func (*TaskRunner) StartEndTimes ¶
func (tr *TaskRunner) StartEndTimes() []*time.Time
func (*TaskRunner) State ¶
func (tr *TaskRunner) State() string
func (*TaskRunner) TaskName ¶
func (tr *TaskRunner) TaskName() string
Click to show internal directories.
Click to hide internal directories.