use_connect

package
v0.0.0-...-a6548e8 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConnectMetadata

func ReadConnectMetadata(ctx context.Context) (int64, error)

Types

type AgentService

type AgentService interface {
	GetById(id int64) (service.Agent, error)
	Update(agent service.Agent) error
	Delete(id int64) error
}

type Connector

type Connector interface {
	Connect(pb.Orchestrator_ConnectServer) error
}

func MakeHandler

func MakeHandler(tasksService TaskService, agentsServise AgentService, distributor Distributor) Connector

type Distributor

type Distributor interface {
	Subscribe(id int64, maxTasks int) <-chan *pb.Task
	Unsubscribe(id int64) error
	Done(id int64) error
	Distribute(task *pb.Task) error
}

type Executor

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

func NewExecutor

func NewExecutor(ts TaskService, as AgentService, d Distributor) *Executor

func (*Executor) GetTasks

func (e *Executor) GetTasks(id int64) (<-chan *pb.Task, error)

func (*Executor) OnConnClose

func (e *Executor) OnConnClose(id int64) error

func (*Executor) OnResult

func (e *Executor) OnResult(id int64, result *pb.ResultResp) error

func (*Executor) OnStart

func (e *Executor) OnStart(id int64) error

func (*Executor) OnTask

func (e *Executor) OnTask(id int64, task *pb.Task) error

type Handler

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

func (*Handler) Connect

func (h *Handler) Connect(conn pb.Orchestrator_ConnectServer) error

type TaskService

type TaskService interface {
	GetById(id int64) (service.Task, error)
	Update(task service.Task) error
	SetUnexecutingForAgent(id int64) error
	GetExecutingForAgent(id int64) ([]service.TaskWithTimeouts, error)
}

Jump to

Keyboard shortcuts

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