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
- func Serve(ctx *context.Context)
- type CoreServer
- func (c *CoreServer) AgentAdd(ctx context.Context, req *drlm.AgentAddRequest) (*drlm.AgentAddResponse, error)
- func (c *CoreServer) AgentConnection(stream drlm.DRLM_AgentConnectionServer) error
- func (c *CoreServer) AgentDelete(ctx context.Context, req *drlm.AgentDeleteRequest) (*drlm.AgentDeleteResponse, error)
- func (c *CoreServer) AgentGet(ctx context.Context, req *drlm.AgentGetRequest) (*drlm.AgentGetResponse, error)
- func (c *CoreServer) AgentInstall(stream drlm.DRLM_AgentInstallServer) error
- func (c *CoreServer) AgentList(ctx context.Context, req *drlm.AgentListRequest) (*drlm.AgentListResponse, error)
- func (c *CoreServer) AgentPluginAdd(stream drlm.DRLM_AgentPluginAddServer) error
- func (c *CoreServer) AgentPluginList(ctx context.Context, req *drlm.AgentPluginListRequest) (*drlm.AgentPluginListResponse, error)
- func (c *CoreServer) AgentPluginRemove(ctx context.Context, req *drlm.AgentPluginRemoveRequest) (*drlm.AgentPluginRemoveResponse, error)
- func (c *CoreServer) AgentPluginUpdate(stream drlm.DRLM_AgentPluginUpdateServer) error
- func (c *CoreServer) JobCancel(ctx context.Context, req *drlm.JobCancelRequest) (*drlm.JobCancelResponse, error)
- func (c *CoreServer) JobList(ctx context.Context, req *drlm.JobListRequest) (*drlm.JobListResponse, error)
- func (c *CoreServer) JobSchedule(ctx context.Context, req *drlm.JobScheduleRequest) (*drlm.JobScheduleResponse, error)
- func (c *CoreServer) UserAdd(ctx context.Context, req *drlm.UserAddRequest) (*drlm.UserAddResponse, error)
- func (c *CoreServer) UserDelete(ctx context.Context, req *drlm.UserDeleteRequest) (*drlm.UserDeleteResponse, error)
- func (c *CoreServer) UserList(ctx context.Context, req *drlm.UserListRequest) (*drlm.UserListResponse, error)
- func (c *CoreServer) UserLogin(ctx context.Context, req *drlm.UserLoginRequest) (*drlm.UserLoginResponse, error)
- func (c *CoreServer) UserTokenRenew(ctx context.Context, req *drlm.UserTokenRenewRequest) (*drlm.UserTokenRenewResponse, error)
Constants ¶
const API = "v1.0.0"
API is the API version of the server
Variables ¶
This section is empty.
Functions ¶
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 ¶
func (c *CoreServer) AgentAdd(ctx context.Context, req *drlm.AgentAddRequest) (*drlm.AgentAddResponse, error)
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 ¶
func (c *CoreServer) AgentDelete(ctx context.Context, req *drlm.AgentDeleteRequest) (*drlm.AgentDeleteResponse, error)
AgentDelete removes the agent from the DB and might do a clenup in the agent machine
func (*CoreServer) AgentGet ¶
func (c *CoreServer) AgentGet(ctx context.Context, req *drlm.AgentGetRequest) (*drlm.AgentGetResponse, error)
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 ¶
func (c *CoreServer) AgentList(ctx context.Context, req *drlm.AgentListRequest) (*drlm.AgentListResponse, error)
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 ¶
func (c *CoreServer) AgentPluginList(ctx context.Context, req *drlm.AgentPluginListRequest) (*drlm.AgentPluginListResponse, error)
AgentPluginList lists the plugins of the Agent
func (*CoreServer) AgentPluginRemove ¶
func (c *CoreServer) AgentPluginRemove(ctx context.Context, req *drlm.AgentPluginRemoveRequest) (*drlm.AgentPluginRemoveResponse, error)
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 ¶
func (c *CoreServer) JobCancel(ctx context.Context, req *drlm.JobCancelRequest) (*drlm.JobCancelResponse, error)
JobCancel cancels an scheduled or running Job
func (*CoreServer) JobList ¶
func (c *CoreServer) JobList(ctx context.Context, req *drlm.JobListRequest) (*drlm.JobListResponse, error)
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 ¶
func (c *CoreServer) JobSchedule(ctx context.Context, req *drlm.JobScheduleRequest) (*drlm.JobScheduleResponse, error)
JobSchedule schedules a new job
func (*CoreServer) UserAdd ¶
func (c *CoreServer) UserAdd(ctx context.Context, req *drlm.UserAddRequest) (*drlm.UserAddResponse, error)
UserAdd creates new users in the DB
func (*CoreServer) UserDelete ¶
func (c *CoreServer) UserDelete(ctx context.Context, req *drlm.UserDeleteRequest) (*drlm.UserDeleteResponse, error)
UserDelete deletes an user from the DB
func (*CoreServer) UserList ¶
func (c *CoreServer) UserList(ctx context.Context, req *drlm.UserListRequest) (*drlm.UserListResponse, error)
UserList lists all the users from the DB
func (*CoreServer) UserLogin ¶
func (c *CoreServer) UserLogin(ctx context.Context, req *drlm.UserLoginRequest) (*drlm.UserLoginResponse, error)
UserLogin logs in users and returns tokens
func (*CoreServer) UserTokenRenew ¶
func (c *CoreServer) UserTokenRenew(ctx context.Context, req *drlm.UserTokenRenewRequest) (*drlm.UserTokenRenewResponse, error)
UserTokenRenew renews the token of the user