Documentation ¶
Index ¶
- type MongoDB
- func (db *MongoDB) CancelTask(ctx context.Context, req *tes.CancelTaskRequest) (*tes.CancelTaskResponse, error)
- func (db *MongoDB) Close() error
- func (db *MongoDB) CreateEvent(ctx context.Context, req *events.Event) (*events.CreateEventResponse, error)
- func (db *MongoDB) CreateTask(ctx context.Context, task *tes.Task) (*tes.CreateTaskResponse, error)
- func (db *MongoDB) DeleteNode(ctx context.Context, req *pbs.Node) error
- func (db *MongoDB) GetNode(ctx context.Context, req *pbs.GetNodeRequest) (*pbs.Node, error)
- func (db *MongoDB) GetServiceInfo(ctx context.Context, info *tes.ServiceInfoRequest) (*tes.ServiceInfo, error)
- func (db *MongoDB) GetTask(ctx context.Context, req *tes.GetTaskRequest) (*tes.Task, error)
- func (db *MongoDB) Init(ctx context.Context) error
- func (db *MongoDB) ListNodes(ctx context.Context, req *pbs.ListNodesRequest) (*pbs.ListNodesResponse, error)
- func (db *MongoDB) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)
- func (db *MongoDB) PutNode(ctx context.Context, node *pbs.Node) (*pbs.PutNodeResponse, error)
- func (db *MongoDB) QueueTask(task *tes.Task) error
- func (db *MongoDB) ReadQueue(n int) []*tes.Task
- func (db *MongoDB) WithComputeBackend(backend compute.Backend)
- func (db *MongoDB) Write(req *events.Event) error
- func (db *MongoDB) WriteContext(ctx context.Context, req *events.Event) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDB ¶
type MongoDB struct {
// contains filtered or unexported fields
}
MongoDB provides an MongoDB database server backend.
func NewMongoDB ¶
NewMongoDB returns a new MongoDB instance.
func (*MongoDB) CancelTask ¶
func (db *MongoDB) CancelTask(ctx context.Context, req *tes.CancelTaskRequest) (*tes.CancelTaskResponse, error)
CancelTask cancels a task
func (*MongoDB) CreateEvent ¶
func (db *MongoDB) CreateEvent(ctx context.Context, req *events.Event) (*events.CreateEventResponse, error)
CreateEvent creates an event for the server to handle.
func (*MongoDB) CreateTask ¶
CreateTask provides an HTTP/gRPC endpoint for creating a task. This is part of the TES implementation.
func (*MongoDB) DeleteNode ¶
DeleteNode deletes a node
func (*MongoDB) GetServiceInfo ¶
func (db *MongoDB) GetServiceInfo(ctx context.Context, info *tes.ServiceInfoRequest) (*tes.ServiceInfo, error)
GetServiceInfo provides an endpoint for Funnel clients to get information about this server.
func (*MongoDB) ListNodes ¶
func (db *MongoDB) ListNodes(ctx context.Context, req *pbs.ListNodesRequest) (*pbs.ListNodesResponse, error)
ListNodes is an API endpoint that returns a list of nodes.
func (*MongoDB) ListTasks ¶
func (db *MongoDB) ListTasks(ctx context.Context, req *tes.ListTasksRequest) (*tes.ListTasksResponse, error)
ListTasks returns a list of taskIDs
func (*MongoDB) PutNode ¶
PutNode is an RPC endpoint that is used by nodes to send heartbeats and status updates, such as completed tasks. The server responds with updated information for the node, such as canceled tasks.
func (*MongoDB) ReadQueue ¶
ReadQueue returns a slice of queued Tasks. Up to "n" tasks are returned.
func (*MongoDB) WithComputeBackend ¶
WithComputeBackend configures the MongoDB instance to use the given compute.Backend. The compute backend is responsible for dispatching tasks to schedulers / compute resources with its Submit method.