agentv1

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentService_Connect_FullMethodName     = "/regulus.agent.v1.AgentService/Connect"
	AgentService_FetchUpdate_FullMethodName = "/regulus.agent.v1.AgentService/FetchUpdate"
)
View Source
const (
	EnrollmentService_Enroll_FullMethodName = "/regulus.agent.v1.EnrollmentService/Enroll"
)

Variables

View Source
var (
	UpdateFile_name = map[int32]string{
		0: "UPDATE_FILE_UNSPECIFIED",
		1: "UPDATE_FILE_ARCHIVE",
		2: "UPDATE_FILE_CHECKSUMS",
		3: "UPDATE_FILE_BUNDLE",
	}
	UpdateFile_value = map[string]int32{
		"UPDATE_FILE_UNSPECIFIED": 0,
		"UPDATE_FILE_ARCHIVE":     1,
		"UPDATE_FILE_CHECKSUMS":   2,
		"UPDATE_FILE_BUNDLE":      3,
	}
)

Enum value maps for UpdateFile.

View Source
var (
	Reject_Reason_name = map[int32]string{
		0: "REASON_UNSPECIFIED",
		1: "REASON_UNSUPPORTED_PROTOCOL_VERSION",
		2: "REASON_UNAUTHORIZED",
		3: "REASON_AGENT_TOO_OLD",
	}
	Reject_Reason_value = map[string]int32{
		"REASON_UNSPECIFIED":                  0,
		"REASON_UNSUPPORTED_PROTOCOL_VERSION": 1,
		"REASON_UNAUTHORIZED":                 2,
		"REASON_AGENT_TOO_OLD":                3,
	}
)

Enum value maps for Reject_Reason.

View Source
var AgentService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "regulus.agent.v1.AgentService",
	HandlerType: (*AgentServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Connect",
			Handler:       _AgentService_Connect_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "FetchUpdate",
			Handler:       _AgentService_FetchUpdate_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "regulus/agent/v1/agent.proto",
}

AgentService_ServiceDesc is the grpc.ServiceDesc for AgentService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var EnrollmentService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "regulus.agent.v1.EnrollmentService",
	HandlerType: (*EnrollmentServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Enroll",
			Handler:    _EnrollmentService_Enroll_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "regulus/agent/v1/enrollment.proto",
}

EnrollmentService_ServiceDesc is the grpc.ServiceDesc for EnrollmentService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_regulus_agent_v1_agent_proto protoreflect.FileDescriptor
View Source
var File_regulus_agent_v1_enrollment_proto protoreflect.FileDescriptor

Functions

func RegisterAgentServiceServer

func RegisterAgentServiceServer(s grpc.ServiceRegistrar, srv AgentServiceServer)

func RegisterEnrollmentServiceServer

func RegisterEnrollmentServiceServer(s grpc.ServiceRegistrar, srv EnrollmentServiceServer)

Types

type AgentMessage

type AgentMessage struct {

	// Types that are valid to be assigned to Payload:
	//
	//	*AgentMessage_Hello
	//	*AgentMessage_Heartbeat
	//	*AgentMessage_Metrics
	//	*AgentMessage_CommandResult
	Payload isAgentMessage_Payload `protobuf_oneof:"payload"`
	// contains filtered or unexported fields
}

Messages sent by the agent.

func (*AgentMessage) Descriptor deprecated

func (*AgentMessage) Descriptor() ([]byte, []int)

Deprecated: Use AgentMessage.ProtoReflect.Descriptor instead.

func (*AgentMessage) GetCommandResult

func (x *AgentMessage) GetCommandResult() *CommandResult

func (*AgentMessage) GetHeartbeat

func (x *AgentMessage) GetHeartbeat() *Heartbeat

func (*AgentMessage) GetHello

func (x *AgentMessage) GetHello() *Hello

func (*AgentMessage) GetMetrics

func (x *AgentMessage) GetMetrics() *MetricsReport

func (*AgentMessage) GetPayload

func (x *AgentMessage) GetPayload() isAgentMessage_Payload

func (*AgentMessage) ProtoMessage

func (*AgentMessage) ProtoMessage()

func (*AgentMessage) ProtoReflect

func (x *AgentMessage) ProtoReflect() protoreflect.Message

func (*AgentMessage) Reset

func (x *AgentMessage) Reset()

func (*AgentMessage) String

func (x *AgentMessage) String() string

type AgentMessage_CommandResult

type AgentMessage_CommandResult struct {
	CommandResult *CommandResult `protobuf:"bytes,4,opt,name=command_result,json=commandResult,proto3,oneof"`
}

type AgentMessage_Heartbeat

type AgentMessage_Heartbeat struct {
	Heartbeat *Heartbeat `protobuf:"bytes,2,opt,name=heartbeat,proto3,oneof"`
}

type AgentMessage_Hello

type AgentMessage_Hello struct {
	Hello *Hello `protobuf:"bytes,1,opt,name=hello,proto3,oneof"`
}

type AgentMessage_Metrics

type AgentMessage_Metrics struct {
	Metrics *MetricsReport `protobuf:"bytes,3,opt,name=metrics,proto3,oneof"`
}

type AgentServiceClient

type AgentServiceClient interface {
	// Connect is the only RPC: a persistent stream carrying everything that
	// flows between an agent and its hub.
	//
	// Flow: the agent sends Hello; the hub answers Welcome or Reject (and ends
	// the stream on Reject). After Welcome the agent sends Heartbeat and
	// MetricsReport messages on the intervals set by the hub, and the hub may
	// send Command messages at any time; each Command is answered by a
	// CommandResult.
	Connect(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[AgentMessage, HubMessage], error)
	// FetchUpdate streams one file of the release the hub offers in an
	// ApplyUpdate command, over the same mTLS connection. The hub serves only
	// the release it runs itself, and the archive of the caller's platform.
	FetchUpdate(ctx context.Context, in *FetchUpdateRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FileChunk], error)
}

AgentServiceClient is the client API for AgentService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type AgentServiceServer

type AgentServiceServer interface {
	// Connect is the only RPC: a persistent stream carrying everything that
	// flows between an agent and its hub.
	//
	// Flow: the agent sends Hello; the hub answers Welcome or Reject (and ends
	// the stream on Reject). After Welcome the agent sends Heartbeat and
	// MetricsReport messages on the intervals set by the hub, and the hub may
	// send Command messages at any time; each Command is answered by a
	// CommandResult.
	Connect(grpc.BidiStreamingServer[AgentMessage, HubMessage]) error
	// FetchUpdate streams one file of the release the hub offers in an
	// ApplyUpdate command, over the same mTLS connection. The hub serves only
	// the release it runs itself, and the archive of the caller's platform.
	FetchUpdate(*FetchUpdateRequest, grpc.ServerStreamingServer[FileChunk]) error
	// contains filtered or unexported methods
}

AgentServiceServer is the server API for AgentService service. All implementations must embed UnimplementedAgentServiceServer for forward compatibility.

type AgentService_ConnectClient

type AgentService_ConnectClient = grpc.BidiStreamingClient[AgentMessage, HubMessage]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type AgentService_ConnectServer

type AgentService_ConnectServer = grpc.BidiStreamingServer[AgentMessage, HubMessage]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type AgentService_FetchUpdateClient

type AgentService_FetchUpdateClient = grpc.ServerStreamingClient[FileChunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type AgentService_FetchUpdateServer

type AgentService_FetchUpdateServer = grpc.ServerStreamingServer[FileChunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type ApplyUpdate

type ApplyUpdate struct {

	// Version to install, for example "0.2.0"; the tag is "v" + version.
	Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	// Name of the archive for the agent's platform.
	Archive string `protobuf:"bytes,2,opt,name=archive,proto3" json:"archive,omitempty"`
	// SHA-256 of the archive, lower-case hex, as listed in the signed
	// checksums.txt.
	Sha256 string `protobuf:"bytes,3,opt,name=sha256,proto3" json:"sha256,omitempty"`
	Size   uint64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"`
	// contains filtered or unexported fields
}

ApplyUpdate offers the agent a new release. The agent downloads the files with FetchUpdate, checks them, and asks the helper of its server (which runs as root) to install them; the result is sent once the files are handed over, and the restarted agent proves the update by connecting with the new version. An agent that predates this command answers "unsupported command".

func (*ApplyUpdate) Descriptor deprecated

func (*ApplyUpdate) Descriptor() ([]byte, []int)

Deprecated: Use ApplyUpdate.ProtoReflect.Descriptor instead.

func (*ApplyUpdate) GetArchive

func (x *ApplyUpdate) GetArchive() string

func (*ApplyUpdate) GetSha256

func (x *ApplyUpdate) GetSha256() string

func (*ApplyUpdate) GetSize

func (x *ApplyUpdate) GetSize() uint64

func (*ApplyUpdate) GetVersion

func (x *ApplyUpdate) GetVersion() string

func (*ApplyUpdate) ProtoMessage

func (*ApplyUpdate) ProtoMessage()

func (*ApplyUpdate) ProtoReflect

func (x *ApplyUpdate) ProtoReflect() protoreflect.Message

func (*ApplyUpdate) Reset

func (x *ApplyUpdate) Reset()

func (*ApplyUpdate) String

func (x *ApplyUpdate) String() string

type Command

type Command struct {

	// Unique per stream; echoed back in CommandResult.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are valid to be assigned to Kind:
	//
	//	*Command_Ping
	//	*Command_SetIntervals
	//	*Command_ApplyUpdate
	Kind isCommand_Kind `protobuf_oneof:"kind"`
	// contains filtered or unexported fields
}

Command is an instruction from the hub. Plugins will add their own command kinds in a later version of the contract.

func (*Command) Descriptor deprecated

func (*Command) Descriptor() ([]byte, []int)

Deprecated: Use Command.ProtoReflect.Descriptor instead.

func (*Command) GetApplyUpdate

func (x *Command) GetApplyUpdate() *ApplyUpdate

func (*Command) GetId

func (x *Command) GetId() string

func (*Command) GetKind

func (x *Command) GetKind() isCommand_Kind

func (*Command) GetPing

func (x *Command) GetPing() *Ping

func (*Command) GetSetIntervals

func (x *Command) GetSetIntervals() *SetIntervals

func (*Command) ProtoMessage

func (*Command) ProtoMessage()

func (*Command) ProtoReflect

func (x *Command) ProtoReflect() protoreflect.Message

func (*Command) Reset

func (x *Command) Reset()

func (*Command) String

func (x *Command) String() string

type CommandResult

type CommandResult struct {
	CommandId string `protobuf:"bytes,1,opt,name=command_id,json=commandId,proto3" json:"command_id,omitempty"`
	Success   bool   `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"`
	// Set when success is false.
	Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

CommandResult is the agent's answer to a Command.

func (*CommandResult) Descriptor deprecated

func (*CommandResult) Descriptor() ([]byte, []int)

Deprecated: Use CommandResult.ProtoReflect.Descriptor instead.

func (*CommandResult) GetCommandId

func (x *CommandResult) GetCommandId() string

func (*CommandResult) GetError

func (x *CommandResult) GetError() string

func (*CommandResult) GetSuccess

func (x *CommandResult) GetSuccess() bool

func (*CommandResult) ProtoMessage

func (*CommandResult) ProtoMessage()

func (*CommandResult) ProtoReflect

func (x *CommandResult) ProtoReflect() protoreflect.Message

func (*CommandResult) Reset

func (x *CommandResult) Reset()

func (*CommandResult) String

func (x *CommandResult) String() string

type Command_ApplyUpdate

type Command_ApplyUpdate struct {
	ApplyUpdate *ApplyUpdate `protobuf:"bytes,4,opt,name=apply_update,json=applyUpdate,proto3,oneof"`
}

type Command_Ping

type Command_Ping struct {
	Ping *Ping `protobuf:"bytes,2,opt,name=ping,proto3,oneof"`
}

type Command_SetIntervals

type Command_SetIntervals struct {
	SetIntervals *SetIntervals `protobuf:"bytes,3,opt,name=set_intervals,json=setIntervals,proto3,oneof"`
}

type CpuMetrics

type CpuMetrics struct {

	// Utilisation over the last interval, 0 to 100, across all cores.
	UsagePercent float64 `protobuf:"fixed64,1,opt,name=usage_percent,json=usagePercent,proto3" json:"usage_percent,omitempty"`
	Load_1       float64 `protobuf:"fixed64,2,opt,name=load_1,json=load1,proto3" json:"load_1,omitempty"`
	Load_5       float64 `protobuf:"fixed64,3,opt,name=load_5,json=load5,proto3" json:"load_5,omitempty"`
	Load_15      float64 `protobuf:"fixed64,4,opt,name=load_15,json=load15,proto3" json:"load_15,omitempty"`
	// contains filtered or unexported fields
}

func (*CpuMetrics) Descriptor deprecated

func (*CpuMetrics) Descriptor() ([]byte, []int)

Deprecated: Use CpuMetrics.ProtoReflect.Descriptor instead.

func (*CpuMetrics) GetLoad_1

func (x *CpuMetrics) GetLoad_1() float64

func (*CpuMetrics) GetLoad_5

func (x *CpuMetrics) GetLoad_5() float64

func (*CpuMetrics) GetLoad_15

func (x *CpuMetrics) GetLoad_15() float64

func (*CpuMetrics) GetUsagePercent

func (x *CpuMetrics) GetUsagePercent() float64

func (*CpuMetrics) ProtoMessage

func (*CpuMetrics) ProtoMessage()

func (*CpuMetrics) ProtoReflect

func (x *CpuMetrics) ProtoReflect() protoreflect.Message

func (*CpuMetrics) Reset

func (x *CpuMetrics) Reset()

func (*CpuMetrics) String

func (x *CpuMetrics) String() string

type DiskMetrics

type DiskMetrics struct {
	MountPoint string `protobuf:"bytes,1,opt,name=mount_point,json=mountPoint,proto3" json:"mount_point,omitempty"`
	Filesystem string `protobuf:"bytes,2,opt,name=filesystem,proto3" json:"filesystem,omitempty"`
	TotalBytes uint64 `protobuf:"varint,3,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"`
	UsedBytes  uint64 `protobuf:"varint,4,opt,name=used_bytes,json=usedBytes,proto3" json:"used_bytes,omitempty"`
	// contains filtered or unexported fields
}

func (*DiskMetrics) Descriptor deprecated

func (*DiskMetrics) Descriptor() ([]byte, []int)

Deprecated: Use DiskMetrics.ProtoReflect.Descriptor instead.

func (*DiskMetrics) GetFilesystem

func (x *DiskMetrics) GetFilesystem() string

func (*DiskMetrics) GetMountPoint

func (x *DiskMetrics) GetMountPoint() string

func (*DiskMetrics) GetTotalBytes

func (x *DiskMetrics) GetTotalBytes() uint64

func (*DiskMetrics) GetUsedBytes

func (x *DiskMetrics) GetUsedBytes() uint64

func (*DiskMetrics) ProtoMessage

func (*DiskMetrics) ProtoMessage()

func (*DiskMetrics) ProtoReflect

func (x *DiskMetrics) ProtoReflect() protoreflect.Message

func (*DiskMetrics) Reset

func (x *DiskMetrics) Reset()

func (*DiskMetrics) String

func (x *DiskMetrics) String() string

type EnrollRequest

type EnrollRequest struct {

	// Enrollment token from the dashboard. Valid once and for a short time.
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// PKCS #10 certificate request (DER) for a key generated on the agent; the
	// private key never leaves the machine. The hub ignores the subject of the
	// request and chooses the agent id.
	CsrDer []byte `protobuf:"bytes,2,opt,name=csr_der,json=csrDer,proto3" json:"csr_der,omitempty"`
	// Describes the machine, so the dashboard can show it right away.
	System       *SystemInfo `protobuf:"bytes,3,opt,name=system,proto3" json:"system,omitempty"`
	AgentVersion string      `protobuf:"bytes,4,opt,name=agent_version,json=agentVersion,proto3" json:"agent_version,omitempty"`
	// contains filtered or unexported fields
}

func (*EnrollRequest) Descriptor deprecated

func (*EnrollRequest) Descriptor() ([]byte, []int)

Deprecated: Use EnrollRequest.ProtoReflect.Descriptor instead.

func (*EnrollRequest) GetAgentVersion

func (x *EnrollRequest) GetAgentVersion() string

func (*EnrollRequest) GetCsrDer

func (x *EnrollRequest) GetCsrDer() []byte

func (*EnrollRequest) GetSystem

func (x *EnrollRequest) GetSystem() *SystemInfo

func (*EnrollRequest) GetToken

func (x *EnrollRequest) GetToken() string

func (*EnrollRequest) ProtoMessage

func (*EnrollRequest) ProtoMessage()

func (*EnrollRequest) ProtoReflect

func (x *EnrollRequest) ProtoReflect() protoreflect.Message

func (*EnrollRequest) Reset

func (x *EnrollRequest) Reset()

func (*EnrollRequest) String

func (x *EnrollRequest) String() string

type EnrollResponse

type EnrollResponse struct {

	// Identifier of the agent; also the common name of its certificate.
	AgentId string `protobuf:"bytes,1,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
	// Client certificate (DER) signed by the hub's internal CA.
	CertificateDer []byte `protobuf:"bytes,2,opt,name=certificate_der,json=certificateDer,proto3" json:"certificate_der,omitempty"`
	// Certificate (DER) of the hub's CA, which the agent trusts from now on.
	CaCertificateDer []byte `protobuf:"bytes,3,opt,name=ca_certificate_der,json=caCertificateDer,proto3" json:"ca_certificate_der,omitempty"`
	// contains filtered or unexported fields
}

func (*EnrollResponse) Descriptor deprecated

func (*EnrollResponse) Descriptor() ([]byte, []int)

Deprecated: Use EnrollResponse.ProtoReflect.Descriptor instead.

func (*EnrollResponse) GetAgentId

func (x *EnrollResponse) GetAgentId() string

func (*EnrollResponse) GetCaCertificateDer

func (x *EnrollResponse) GetCaCertificateDer() []byte

func (*EnrollResponse) GetCertificateDer

func (x *EnrollResponse) GetCertificateDer() []byte

func (*EnrollResponse) ProtoMessage

func (*EnrollResponse) ProtoMessage()

func (*EnrollResponse) ProtoReflect

func (x *EnrollResponse) ProtoReflect() protoreflect.Message

func (*EnrollResponse) Reset

func (x *EnrollResponse) Reset()

func (*EnrollResponse) String

func (x *EnrollResponse) String() string

type EnrollmentServiceClient

type EnrollmentServiceClient interface {
	Enroll(ctx context.Context, in *EnrollRequest, opts ...grpc.CallOption) (*EnrollResponse, error)
}

EnrollmentServiceClient is the client API for EnrollmentService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

EnrollmentService registers a new agent with the hub. It is the only RPC that does not need a client certificate: the agent proves it may join with a single-use enrollment token created by an admin, and receives the client certificate it uses for every later connection.

type EnrollmentServiceServer

type EnrollmentServiceServer interface {
	Enroll(context.Context, *EnrollRequest) (*EnrollResponse, error)
	// contains filtered or unexported methods
}

EnrollmentServiceServer is the server API for EnrollmentService service. All implementations must embed UnimplementedEnrollmentServiceServer for forward compatibility.

EnrollmentService registers a new agent with the hub. It is the only RPC that does not need a client certificate: the agent proves it may join with a single-use enrollment token created by an admin, and receives the client certificate it uses for every later connection.

type FetchUpdateRequest

type FetchUpdateRequest struct {
	Version string     `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	File    UpdateFile `protobuf:"varint,2,opt,name=file,proto3,enum=regulus.agent.v1.UpdateFile" json:"file,omitempty"`
	// contains filtered or unexported fields
}

func (*FetchUpdateRequest) Descriptor deprecated

func (*FetchUpdateRequest) Descriptor() ([]byte, []int)

Deprecated: Use FetchUpdateRequest.ProtoReflect.Descriptor instead.

func (*FetchUpdateRequest) GetFile

func (x *FetchUpdateRequest) GetFile() UpdateFile

func (*FetchUpdateRequest) GetVersion

func (x *FetchUpdateRequest) GetVersion() string

func (*FetchUpdateRequest) ProtoMessage

func (*FetchUpdateRequest) ProtoMessage()

func (*FetchUpdateRequest) ProtoReflect

func (x *FetchUpdateRequest) ProtoReflect() protoreflect.Message

func (*FetchUpdateRequest) Reset

func (x *FetchUpdateRequest) Reset()

func (*FetchUpdateRequest) String

func (x *FetchUpdateRequest) String() string

type FileChunk

type FileChunk struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*FileChunk) Descriptor deprecated

func (*FileChunk) Descriptor() ([]byte, []int)

Deprecated: Use FileChunk.ProtoReflect.Descriptor instead.

func (*FileChunk) GetData

func (x *FileChunk) GetData() []byte

func (*FileChunk) ProtoMessage

func (*FileChunk) ProtoMessage()

func (*FileChunk) ProtoReflect

func (x *FileChunk) ProtoReflect() protoreflect.Message

func (*FileChunk) Reset

func (x *FileChunk) Reset()

func (*FileChunk) String

func (x *FileChunk) String() string

type Heartbeat

type Heartbeat struct {
	SentAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=sent_at,json=sentAt,proto3" json:"sent_at,omitempty"`
	// contains filtered or unexported fields
}

Heartbeat tells the hub the agent is alive.

func (*Heartbeat) Descriptor deprecated

func (*Heartbeat) Descriptor() ([]byte, []int)

Deprecated: Use Heartbeat.ProtoReflect.Descriptor instead.

func (*Heartbeat) GetSentAt

func (x *Heartbeat) GetSentAt() *timestamppb.Timestamp

func (*Heartbeat) ProtoMessage

func (*Heartbeat) ProtoMessage()

func (*Heartbeat) ProtoReflect

func (x *Heartbeat) ProtoReflect() protoreflect.Message

func (*Heartbeat) Reset

func (x *Heartbeat) Reset()

func (*Heartbeat) String

func (x *Heartbeat) String() string

type Hello

type Hello struct {

	// Highest protocol version the agent speaks (see internal/protocol).
	ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
	// Release version of the agent, for display and update decisions.
	AgentVersion string `protobuf:"bytes,2,opt,name=agent_version,json=agentVersion,proto3" json:"agent_version,omitempty"`
	// Stable identifier of the agent. Empty on the very first connection, when
	// the hub assigns one in Welcome.
	AgentId string      `protobuf:"bytes,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
	System  *SystemInfo `protobuf:"bytes,4,opt,name=system,proto3" json:"system,omitempty"`
	// Lowest protocol version the agent still speaks. Zero (an agent that
	// predates this field) means it speaks only protocol_version. The hub picks
	// the highest version both sides speak.
	MinProtocolVersion uint32 `protobuf:"varint,5,opt,name=min_protocol_version,json=minProtocolVersion,proto3" json:"min_protocol_version,omitempty"`
	// contains filtered or unexported fields
}

Hello is the first message of every stream: it registers the agent.

func (*Hello) Descriptor deprecated

func (*Hello) Descriptor() ([]byte, []int)

Deprecated: Use Hello.ProtoReflect.Descriptor instead.

func (*Hello) GetAgentId

func (x *Hello) GetAgentId() string

func (*Hello) GetAgentVersion

func (x *Hello) GetAgentVersion() string

func (*Hello) GetMinProtocolVersion

func (x *Hello) GetMinProtocolVersion() uint32

func (*Hello) GetProtocolVersion

func (x *Hello) GetProtocolVersion() uint32

func (*Hello) GetSystem

func (x *Hello) GetSystem() *SystemInfo

func (*Hello) ProtoMessage

func (*Hello) ProtoMessage()

func (*Hello) ProtoReflect

func (x *Hello) ProtoReflect() protoreflect.Message

func (*Hello) Reset

func (x *Hello) Reset()

func (*Hello) String

func (x *Hello) String() string

type HubMessage

type HubMessage struct {

	// Types that are valid to be assigned to Payload:
	//
	//	*HubMessage_Welcome
	//	*HubMessage_Reject
	//	*HubMessage_Command
	Payload isHubMessage_Payload `protobuf_oneof:"payload"`
	// contains filtered or unexported fields
}

Messages sent by the hub.

func (*HubMessage) Descriptor deprecated

func (*HubMessage) Descriptor() ([]byte, []int)

Deprecated: Use HubMessage.ProtoReflect.Descriptor instead.

func (*HubMessage) GetCommand

func (x *HubMessage) GetCommand() *Command

func (*HubMessage) GetPayload

func (x *HubMessage) GetPayload() isHubMessage_Payload

func (*HubMessage) GetReject

func (x *HubMessage) GetReject() *Reject

func (*HubMessage) GetWelcome

func (x *HubMessage) GetWelcome() *Welcome

func (*HubMessage) ProtoMessage

func (*HubMessage) ProtoMessage()

func (*HubMessage) ProtoReflect

func (x *HubMessage) ProtoReflect() protoreflect.Message

func (*HubMessage) Reset

func (x *HubMessage) Reset()

func (*HubMessage) String

func (x *HubMessage) String() string

type HubMessage_Command

type HubMessage_Command struct {
	Command *Command `protobuf:"bytes,3,opt,name=command,proto3,oneof"`
}

type HubMessage_Reject

type HubMessage_Reject struct {
	Reject *Reject `protobuf:"bytes,2,opt,name=reject,proto3,oneof"`
}

type HubMessage_Welcome

type HubMessage_Welcome struct {
	Welcome *Welcome `protobuf:"bytes,1,opt,name=welcome,proto3,oneof"`
}

type MemoryMetrics

type MemoryMetrics struct {
	TotalBytes     uint64 `protobuf:"varint,1,opt,name=total_bytes,json=totalBytes,proto3" json:"total_bytes,omitempty"`
	UsedBytes      uint64 `protobuf:"varint,2,opt,name=used_bytes,json=usedBytes,proto3" json:"used_bytes,omitempty"`
	AvailableBytes uint64 `protobuf:"varint,3,opt,name=available_bytes,json=availableBytes,proto3" json:"available_bytes,omitempty"`
	SwapTotalBytes uint64 `protobuf:"varint,4,opt,name=swap_total_bytes,json=swapTotalBytes,proto3" json:"swap_total_bytes,omitempty"`
	SwapUsedBytes  uint64 `protobuf:"varint,5,opt,name=swap_used_bytes,json=swapUsedBytes,proto3" json:"swap_used_bytes,omitempty"`
	// contains filtered or unexported fields
}

func (*MemoryMetrics) Descriptor deprecated

func (*MemoryMetrics) Descriptor() ([]byte, []int)

Deprecated: Use MemoryMetrics.ProtoReflect.Descriptor instead.

func (*MemoryMetrics) GetAvailableBytes

func (x *MemoryMetrics) GetAvailableBytes() uint64

func (*MemoryMetrics) GetSwapTotalBytes

func (x *MemoryMetrics) GetSwapTotalBytes() uint64

func (*MemoryMetrics) GetSwapUsedBytes

func (x *MemoryMetrics) GetSwapUsedBytes() uint64

func (*MemoryMetrics) GetTotalBytes

func (x *MemoryMetrics) GetTotalBytes() uint64

func (*MemoryMetrics) GetUsedBytes

func (x *MemoryMetrics) GetUsedBytes() uint64

func (*MemoryMetrics) ProtoMessage

func (*MemoryMetrics) ProtoMessage()

func (*MemoryMetrics) ProtoReflect

func (x *MemoryMetrics) ProtoReflect() protoreflect.Message

func (*MemoryMetrics) Reset

func (x *MemoryMetrics) Reset()

func (*MemoryMetrics) String

func (x *MemoryMetrics) String() string

type MetricsReport

type MetricsReport struct {
	CollectedAt   *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=collected_at,json=collectedAt,proto3" json:"collected_at,omitempty"`
	Cpu           *CpuMetrics            `protobuf:"bytes,2,opt,name=cpu,proto3" json:"cpu,omitempty"`
	Memory        *MemoryMetrics         `protobuf:"bytes,3,opt,name=memory,proto3" json:"memory,omitempty"`
	Disks         []*DiskMetrics         `protobuf:"bytes,4,rep,name=disks,proto3" json:"disks,omitempty"`
	Networks      []*NetworkMetrics      `protobuf:"bytes,5,rep,name=networks,proto3" json:"networks,omitempty"`
	UptimeSeconds uint64                 `protobuf:"varint,6,opt,name=uptime_seconds,json=uptimeSeconds,proto3" json:"uptime_seconds,omitempty"`
	// contains filtered or unexported fields
}

MetricsReport is a snapshot of the machine state.

func (*MetricsReport) Descriptor deprecated

func (*MetricsReport) Descriptor() ([]byte, []int)

Deprecated: Use MetricsReport.ProtoReflect.Descriptor instead.

func (*MetricsReport) GetCollectedAt

func (x *MetricsReport) GetCollectedAt() *timestamppb.Timestamp

func (*MetricsReport) GetCpu

func (x *MetricsReport) GetCpu() *CpuMetrics

func (*MetricsReport) GetDisks

func (x *MetricsReport) GetDisks() []*DiskMetrics

func (*MetricsReport) GetMemory

func (x *MetricsReport) GetMemory() *MemoryMetrics

func (*MetricsReport) GetNetworks

func (x *MetricsReport) GetNetworks() []*NetworkMetrics

func (*MetricsReport) GetUptimeSeconds

func (x *MetricsReport) GetUptimeSeconds() uint64

func (*MetricsReport) ProtoMessage

func (*MetricsReport) ProtoMessage()

func (*MetricsReport) ProtoReflect

func (x *MetricsReport) ProtoReflect() protoreflect.Message

func (*MetricsReport) Reset

func (x *MetricsReport) Reset()

func (*MetricsReport) String

func (x *MetricsReport) String() string

type NetworkMetrics

type NetworkMetrics struct {
	Interface string `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"`
	// Monotonic counters since boot; the hub computes rates.
	RxBytes uint64 `protobuf:"varint,2,opt,name=rx_bytes,json=rxBytes,proto3" json:"rx_bytes,omitempty"`
	TxBytes uint64 `protobuf:"varint,3,opt,name=tx_bytes,json=txBytes,proto3" json:"tx_bytes,omitempty"`
	// contains filtered or unexported fields
}

func (*NetworkMetrics) Descriptor deprecated

func (*NetworkMetrics) Descriptor() ([]byte, []int)

Deprecated: Use NetworkMetrics.ProtoReflect.Descriptor instead.

func (*NetworkMetrics) GetInterface

func (x *NetworkMetrics) GetInterface() string

func (*NetworkMetrics) GetRxBytes

func (x *NetworkMetrics) GetRxBytes() uint64

func (*NetworkMetrics) GetTxBytes

func (x *NetworkMetrics) GetTxBytes() uint64

func (*NetworkMetrics) ProtoMessage

func (*NetworkMetrics) ProtoMessage()

func (*NetworkMetrics) ProtoReflect

func (x *NetworkMetrics) ProtoReflect() protoreflect.Message

func (*NetworkMetrics) Reset

func (x *NetworkMetrics) Reset()

func (*NetworkMetrics) String

func (x *NetworkMetrics) String() string

type Ping

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

Ping asks the agent to answer with a successful CommandResult.

func (*Ping) Descriptor deprecated

func (*Ping) Descriptor() ([]byte, []int)

Deprecated: Use Ping.ProtoReflect.Descriptor instead.

func (*Ping) ProtoMessage

func (*Ping) ProtoMessage()

func (*Ping) ProtoReflect

func (x *Ping) ProtoReflect() protoreflect.Message

func (*Ping) Reset

func (x *Ping) Reset()

func (*Ping) String

func (x *Ping) String() string

type Reject

type Reject struct {
	Reason Reject_Reason `protobuf:"varint,1,opt,name=reason,proto3,enum=regulus.agent.v1.Reject_Reason" json:"reason,omitempty"`
	// Human readable explanation, safe to show in the dashboard.
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// Protocol versions the hub accepts, to help the operator upgrade.
	MinProtocolVersion uint32 `protobuf:"varint,3,opt,name=min_protocol_version,json=minProtocolVersion,proto3" json:"min_protocol_version,omitempty"`
	MaxProtocolVersion uint32 `protobuf:"varint,4,opt,name=max_protocol_version,json=maxProtocolVersion,proto3" json:"max_protocol_version,omitempty"`
	// contains filtered or unexported fields
}

Reject refuses the agent; the hub closes the stream right after.

func (*Reject) Descriptor deprecated

func (*Reject) Descriptor() ([]byte, []int)

Deprecated: Use Reject.ProtoReflect.Descriptor instead.

func (*Reject) GetMaxProtocolVersion

func (x *Reject) GetMaxProtocolVersion() uint32

func (*Reject) GetMessage

func (x *Reject) GetMessage() string

func (*Reject) GetMinProtocolVersion

func (x *Reject) GetMinProtocolVersion() uint32

func (*Reject) GetReason

func (x *Reject) GetReason() Reject_Reason

func (*Reject) ProtoMessage

func (*Reject) ProtoMessage()

func (*Reject) ProtoReflect

func (x *Reject) ProtoReflect() protoreflect.Message

func (*Reject) Reset

func (x *Reject) Reset()

func (*Reject) String

func (x *Reject) String() string

type Reject_Reason

type Reject_Reason int32
const (
	Reject_REASON_UNSPECIFIED                  Reject_Reason = 0
	Reject_REASON_UNSUPPORTED_PROTOCOL_VERSION Reject_Reason = 1
	Reject_REASON_UNAUTHORIZED                 Reject_Reason = 2
	// The protocol would work but the release of the agent is further behind
	// the hub than the hub supports (the current and the previous release
	// series are accepted). Update the agent.
	Reject_REASON_AGENT_TOO_OLD Reject_Reason = 3
)

func (Reject_Reason) Descriptor

func (Reject_Reason) Enum

func (x Reject_Reason) Enum() *Reject_Reason

func (Reject_Reason) EnumDescriptor deprecated

func (Reject_Reason) EnumDescriptor() ([]byte, []int)

Deprecated: Use Reject_Reason.Descriptor instead.

func (Reject_Reason) Number

func (Reject_Reason) String

func (x Reject_Reason) String() string

func (Reject_Reason) Type

type SetIntervals

type SetIntervals struct {
	HeartbeatInterval *durationpb.Duration `protobuf:"bytes,1,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"`
	MetricsInterval   *durationpb.Duration `protobuf:"bytes,2,opt,name=metrics_interval,json=metricsInterval,proto3" json:"metrics_interval,omitempty"`
	// contains filtered or unexported fields
}

SetIntervals changes the reporting intervals. A zero value keeps the current one.

func (*SetIntervals) Descriptor deprecated

func (*SetIntervals) Descriptor() ([]byte, []int)

Deprecated: Use SetIntervals.ProtoReflect.Descriptor instead.

func (*SetIntervals) GetHeartbeatInterval

func (x *SetIntervals) GetHeartbeatInterval() *durationpb.Duration

func (*SetIntervals) GetMetricsInterval

func (x *SetIntervals) GetMetricsInterval() *durationpb.Duration

func (*SetIntervals) ProtoMessage

func (*SetIntervals) ProtoMessage()

func (*SetIntervals) ProtoReflect

func (x *SetIntervals) ProtoReflect() protoreflect.Message

func (*SetIntervals) Reset

func (x *SetIntervals) Reset()

func (*SetIntervals) String

func (x *SetIntervals) String() string

type SystemInfo

type SystemInfo struct {
	Hostname         string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
	Os               string `protobuf:"bytes,2,opt,name=os,proto3" json:"os,omitempty"`                                // for example "linux"
	OsVersion        string `protobuf:"bytes,3,opt,name=os_version,json=osVersion,proto3" json:"os_version,omitempty"` // for example "Ubuntu 24.04.1 LTS"
	Kernel           string `protobuf:"bytes,4,opt,name=kernel,proto3" json:"kernel,omitempty"`
	Arch             string `protobuf:"bytes,5,opt,name=arch,proto3" json:"arch,omitempty"` // for example "amd64", "arm64"
	CpuCount         uint32 `protobuf:"varint,6,opt,name=cpu_count,json=cpuCount,proto3" json:"cpu_count,omitempty"`
	MemoryTotalBytes uint64 `protobuf:"varint,7,opt,name=memory_total_bytes,json=memoryTotalBytes,proto3" json:"memory_total_bytes,omitempty"`
	// contains filtered or unexported fields
}

SystemInfo describes the machine the agent runs on. It rarely changes.

func (*SystemInfo) Descriptor deprecated

func (*SystemInfo) Descriptor() ([]byte, []int)

Deprecated: Use SystemInfo.ProtoReflect.Descriptor instead.

func (*SystemInfo) GetArch

func (x *SystemInfo) GetArch() string

func (*SystemInfo) GetCpuCount

func (x *SystemInfo) GetCpuCount() uint32

func (*SystemInfo) GetHostname

func (x *SystemInfo) GetHostname() string

func (*SystemInfo) GetKernel

func (x *SystemInfo) GetKernel() string

func (*SystemInfo) GetMemoryTotalBytes

func (x *SystemInfo) GetMemoryTotalBytes() uint64

func (*SystemInfo) GetOs

func (x *SystemInfo) GetOs() string

func (*SystemInfo) GetOsVersion

func (x *SystemInfo) GetOsVersion() string

func (*SystemInfo) ProtoMessage

func (*SystemInfo) ProtoMessage()

func (*SystemInfo) ProtoReflect

func (x *SystemInfo) ProtoReflect() protoreflect.Message

func (*SystemInfo) Reset

func (x *SystemInfo) Reset()

func (*SystemInfo) String

func (x *SystemInfo) String() string

type UnimplementedAgentServiceServer

type UnimplementedAgentServiceServer struct{}

UnimplementedAgentServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedAgentServiceServer) Connect

func (UnimplementedAgentServiceServer) FetchUpdate

type UnimplementedEnrollmentServiceServer

type UnimplementedEnrollmentServiceServer struct{}

UnimplementedEnrollmentServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedEnrollmentServiceServer) Enroll

type UnsafeAgentServiceServer

type UnsafeAgentServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeAgentServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AgentServiceServer will result in compilation errors.

type UnsafeEnrollmentServiceServer

type UnsafeEnrollmentServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeEnrollmentServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EnrollmentServiceServer will result in compilation errors.

type UpdateFile

type UpdateFile int32

Files of a release that FetchUpdate serves.

const (
	UpdateFile_UPDATE_FILE_UNSPECIFIED UpdateFile = 0
	// The archive of the caller's platform.
	UpdateFile_UPDATE_FILE_ARCHIVE UpdateFile = 1
	// checksums.txt, which the release workflow signed.
	UpdateFile_UPDATE_FILE_CHECKSUMS UpdateFile = 2
	// checksums.txt.sigstore.json, the Sigstore bundle of that signature.
	UpdateFile_UPDATE_FILE_BUNDLE UpdateFile = 3
)

func (UpdateFile) Descriptor

func (UpdateFile) Descriptor() protoreflect.EnumDescriptor

func (UpdateFile) Enum

func (x UpdateFile) Enum() *UpdateFile

func (UpdateFile) EnumDescriptor deprecated

func (UpdateFile) EnumDescriptor() ([]byte, []int)

Deprecated: Use UpdateFile.Descriptor instead.

func (UpdateFile) Number

func (x UpdateFile) Number() protoreflect.EnumNumber

func (UpdateFile) String

func (x UpdateFile) String() string

func (UpdateFile) Type

type Welcome

type Welcome struct {

	// Protocol version negotiated for this stream.
	ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
	HubVersion      string `protobuf:"bytes,2,opt,name=hub_version,json=hubVersion,proto3" json:"hub_version,omitempty"`
	// Identifier of the agent; equals Hello.agent_id when it was provided.
	AgentId string `protobuf:"bytes,3,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"`
	// How often the agent must send a Heartbeat.
	HeartbeatInterval *durationpb.Duration `protobuf:"bytes,4,opt,name=heartbeat_interval,json=heartbeatInterval,proto3" json:"heartbeat_interval,omitempty"`
	// How often the agent must send a MetricsReport.
	MetricsInterval *durationpb.Duration `protobuf:"bytes,5,opt,name=metrics_interval,json=metricsInterval,proto3" json:"metrics_interval,omitempty"`
	// contains filtered or unexported fields
}

Welcome accepts the agent and configures the stream.

func (*Welcome) Descriptor deprecated

func (*Welcome) Descriptor() ([]byte, []int)

Deprecated: Use Welcome.ProtoReflect.Descriptor instead.

func (*Welcome) GetAgentId

func (x *Welcome) GetAgentId() string

func (*Welcome) GetHeartbeatInterval

func (x *Welcome) GetHeartbeatInterval() *durationpb.Duration

func (*Welcome) GetHubVersion

func (x *Welcome) GetHubVersion() string

func (*Welcome) GetMetricsInterval

func (x *Welcome) GetMetricsInterval() *durationpb.Duration

func (*Welcome) GetProtocolVersion

func (x *Welcome) GetProtocolVersion() uint32

func (*Welcome) ProtoMessage

func (*Welcome) ProtoMessage()

func (*Welcome) ProtoReflect

func (x *Welcome) ProtoReflect() protoreflect.Message

func (*Welcome) Reset

func (x *Welcome) Reset()

func (*Welcome) String

func (x *Welcome) String() string

Jump to

Keyboard shortcuts

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