server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMetadataUniqueKey

func GetMetadataUniqueKey(ctx context.Context, key string) (string, error)

Types

type Server

type Server struct {
	proto.UnimplementedClusterServer

	Inventory *inventory.Agents
	// contains filtered or unexported fields
}

func New

func New(config ServerConfig, agentsInventory *inventory.Agents, taskDispatcher forwarder.Dispatcher[*proto.TaskRequest, *proto.TaskResponse], jobDatabase *badger.DB) Server

func (*Server) CollectAgentsSpecs

func (s *Server) CollectAgentsSpecs(ctx context.Context)

func (*Server) ExecTask

func (s *Server) ExecTask(stream proto.Cluster_ExecTaskServer) error

ExecTask spawn a stream with each agents.

It handles the sending of requests and the routing of the response. The responses is routed to the dispatcher (usually the forwarder).

func (*Server) GetInventory

func (s *Server) GetInventory() *inventory.Agents

GetInventory returns the server's inventory.

func (*Server) Handshake

Handshake handle agent registration.

It checks if the agent changed to detect potential rogue.

func (*Server) ListAgentPlugins

func (s *Server) ListAgentPlugins(ctx context.Context, req *emptypb.Empty) (*proto.ListAgentPluginsResponse, error)

func (*Server) RequestShutdown

func (s *Server) RequestShutdown(agentID agent.ID) error

type ServerConfig

type ServerConfig struct {
	AutoAccept  bool
	MTLSEnabled bool
	ConfigDir   string
	PluginDir   string
}

Jump to

Keyboard shortcuts

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