master

package
v0.0.0-...-adb0196 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Master

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

Master provides a task scheduler with HA and auto reconcile support.

func NewMaster

func NewMaster(cfg *conf.ClusterCfg, id string) (*Master, error)

NewMaster creates a new master instance.

func (*Master) AddTask

func (m *Master) AddTask(req *pb.Task) (*pb.Worker, error)

AddTask adds a new task.

func (*Master) DeleteTask

func (m *Master) DeleteTask(uuid string) error

DeleteTask deletes a specific task.

func (*Master) GetTask

func (m *Master) GetTask(uuid string, loadStatus bool) (*pb.Task, error)

GetTask gets a specific task.

func (*Master) GetWorker

func (m *Master) GetWorker(id string) (*pb.Worker, error)

GetWorker gets a specific worker.

func (*Master) ListTasks

func (m *Master) ListTasks(id string, loadStatus bool) ([]*pb.Task, error)

ListTasks lists all tasks.

func (*Master) ListWorkers

func (m *Master) ListWorkers() ([]*pb.Worker, error)

ListWorkers lists all workers.

func (*Master) Run

func (m *Master) Run()

Run runs master routine loop.

func (*Master) Stop

func (m *Master) Stop()

Stop stops the manager, and waits until main loop exits.

Jump to

Keyboard shortcuts

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