grpc

package
v0.0.0-...-383e6fc Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package grpc is the responsible for implementing the GRPC service defined at github.com/brainupdaters/drlm-common/pkg/proto It basically parses the requests and calls the other packages

Index

Constants

View Source
const API = "v1.0.0"

API is the API version of the server

Variables

This section is empty.

Functions

func Serve

func Serve(ctx *context.Context)

Serve starts the DRLM Core GRPC server

Types

type CoreServer

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

CoreServer is the implementation of the DRLM Core GRPC server

func NewCoreServer

func NewCoreServer(ctx *context.Context) *CoreServer

NewCoreServer returns a new CoreServer struct with the context inside

func (*CoreServer) AgentAdd

AgentAdd adds a new Agent to the DB

func (*CoreServer) AgentConnection

func (c *CoreServer) AgentConnection(stream drlm.DRLM_AgentConnectionServer) error

AgentConnection creates the connection between the Agent and the Core. It's used for both notifying new jobs and for returning the response / updates of them

func (*CoreServer) AgentDelete

AgentDelete removes the agent from the DB and might do a clenup in the agent machine

func (*CoreServer) AgentGet

AgentGet returns a specific agent by host

func (*CoreServer) AgentInstall

func (c *CoreServer) AgentInstall(stream drlm.DRLM_AgentInstallServer) error

AgentInstall installs the agent binary to the agent machine

func (*CoreServer) AgentList

AgentList returns a list of all the agents

func (*CoreServer) AgentPluginAdd

func (c *CoreServer) AgentPluginAdd(stream drlm.DRLM_AgentPluginAddServer) error

AgentPluginAdd adds a new plugin to the Agent

func (*CoreServer) AgentPluginList

AgentPluginList lists the plugins of the Agent

func (*CoreServer) AgentPluginRemove

AgentPluginRemove removes a plugin from the Agent

func (*CoreServer) AgentPluginUpdate

func (c *CoreServer) AgentPluginUpdate(stream drlm.DRLM_AgentPluginUpdateServer) error

AgentPluginUpdate updates a plugin of the Agent

func (*CoreServer) JobCancel

JobCancel cancels an scheduled or running Job

func (*CoreServer) JobList

JobList returns a list with the the jobs of an agent. If the agent Host is "", it will return all the jobs

func (*CoreServer) JobSchedule

JobSchedule schedules a new job

func (*CoreServer) UserAdd

UserAdd creates new users in the DB

func (*CoreServer) UserDelete

UserDelete deletes an user from the DB

func (*CoreServer) UserList

UserList lists all the users from the DB

func (*CoreServer) UserLogin

UserLogin logs in users and returns tokens

func (*CoreServer) UserTokenRenew

UserTokenRenew renews the token of the user

Jump to

Keyboard shortcuts

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