task

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTaskPermission added in v0.2.3

func CheckTaskPermission(ctx context.Context, resourceId string) (*models.Task, error)

func CheckTasksPermission added in v0.2.3

func CheckTasksPermission(ctx context.Context, resourceIds []string) ([]*models.Task, error)

func Serve

func Serve(cfg *config.Config)

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(hostname string) *Controller

func (*Controller) ExtractTasks

func (c *Controller) ExtractTasks(ctx context.Context)

func (*Controller) GetTaskLength

func (c *Controller) GetTaskLength() int32

func (*Controller) HandleTask

func (c *Controller) HandleTask(ctx context.Context, taskId string, cb func()) error

func (*Controller) HandleTasks

func (c *Controller) HandleTasks(ctx context.Context)

func (*Controller) IsRunningExceed

func (c *Controller) IsRunningExceed() bool

func (*Controller) Serve

func (c *Controller) Serve()

func (*Controller) UpdateWorkingTasks added in v0.2.3

func (c *Controller) UpdateWorkingTasks(ctx context.Context) error

type Processor

type Processor struct {
	Task *models.Task
}

func NewProcessor

func NewProcessor(task *models.Task) *Processor

func (*Processor) Post

func (p *Processor) Post(ctx context.Context) error

Post process when task is done

func (*Processor) Pre

func (p *Processor) Pre(ctx context.Context) error

Post process when task is start

type Server

type Server struct {
	// contains filtered or unexported fields
}

func (*Server) CreateTask

func (p *Server) CreateTask(ctx context.Context, req *pb.CreateTaskRequest) (*pb.CreateTaskResponse, error)

func (*Server) DescribeTasks

func (p *Server) DescribeTasks(ctx context.Context, req *pb.DescribeTasksRequest) (*pb.DescribeTasksResponse, error)

func (*Server) RetryTasks

func (p *Server) RetryTasks(ctx context.Context, req *pb.RetryTasksRequest) (*pb.RetryTasksResponse, error)

Jump to

Keyboard shortcuts

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