messaging

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// MessageTypeHeartbeat represents a heartbeat message sent
	// by the agent.
	MessageTypeHeartbeat byte = 0x01
	// MessageTypeStatusMessage is a status message setnt by the agent
	MessageTypeStatusMessage byte = 0x03
	// Shell session messages
	MessageTypeCreateShell       byte = 0x04
	MessageTypeShellReady        byte = 0x05
	MessageTypeShellData         byte = 0x06
	MessageTypeShellResize       byte = 0x07
	MessageTypeShellExit         byte = 0x08
	MessageTypeClientShellClosed byte = 0x09
)

Variables

This section is empty.

Functions

func Unmarshal

func Unmarshal[T any, PT interface {
	*T
	MessageUnmarshaler
}](msg AgentMessage) (T, error)

Unmarshal unmarshals AgentMessage data into a specific message type using generics

Types

type AgentMessage

type AgentMessage struct {
	Type byte
	Data []byte
}

func UnmarshalAgentMessage

func UnmarshalAgentMessage(data []byte) (AgentMessage, error)

func (AgentMessage) Marshal

func (a AgentMessage) Marshal() []byte

type ClientShellClosedMessage

type ClientShellClosedMessage struct {
	SessionID [16]byte
}

func (*ClientShellClosedMessage) ID

func (ClientShellClosedMessage) Marshal

func (c ClientShellClosedMessage) Marshal() []byte

func (*ClientShellClosedMessage) UnmarshalFromAgentMessage

func (c *ClientShellClosedMessage) UnmarshalFromAgentMessage(data []byte) error

type CreateShellMessage

type CreateShellMessage struct {
	SessionID [16]byte
	Rows      uint32
	Cols      uint32
}

func (*CreateShellMessage) ID

func (c *CreateShellMessage) ID() string

func (CreateShellMessage) Marshal

func (c CreateShellMessage) Marshal() []byte

func (*CreateShellMessage) UnmarshalFromAgentMessage

func (c *CreateShellMessage) UnmarshalFromAgentMessage(data []byte) error

type MessageUnmarshaler

type MessageUnmarshaler interface {
	UnmarshalFromAgentMessage(data []byte) error
}

MessageUnmarshaler defines types that can unmarshal from AgentMessage data

type RunnerHeartbetMessage

type RunnerHeartbetMessage struct {
	AgentID uint64
	Payload []byte
}

func (RunnerHeartbetMessage) Marshal

func (s RunnerHeartbetMessage) Marshal() []byte

func (*RunnerHeartbetMessage) UnmarshalFromAgentMessage

func (s *RunnerHeartbetMessage) UnmarshalFromAgentMessage(data []byte) error

type RunnerUpdateMessage

type RunnerUpdateMessage struct {
	AgentID uint64
	Payload []byte
}

func (RunnerUpdateMessage) Marshal

func (s RunnerUpdateMessage) Marshal() []byte

func (*RunnerUpdateMessage) UnmarshalFromAgentMessage

func (s *RunnerUpdateMessage) UnmarshalFromAgentMessage(data []byte) error

type ShellDataMessage

type ShellDataMessage struct {
	SessionID [16]byte
	Data      []byte
}

func (*ShellDataMessage) ID

func (c *ShellDataMessage) ID() string

func (ShellDataMessage) Marshal

func (c ShellDataMessage) Marshal() []byte

func (*ShellDataMessage) UnmarshalFromAgentMessage

func (c *ShellDataMessage) UnmarshalFromAgentMessage(data []byte) error

type ShellExitMessage

type ShellExitMessage struct {
	SessionID [16]byte
}

func (*ShellExitMessage) ID

func (c *ShellExitMessage) ID() string

func (ShellExitMessage) Marshal

func (c ShellExitMessage) Marshal() []byte

func (*ShellExitMessage) UnmarshalFromAgentMessage

func (c *ShellExitMessage) UnmarshalFromAgentMessage(data []byte) error

type ShellReadyMessage

type ShellReadyMessage struct {
	SessionID [16]byte
	IsError   byte
	Message   []byte
}

func (*ShellReadyMessage) ID

func (c *ShellReadyMessage) ID() string

func (ShellReadyMessage) Marshal

func (c ShellReadyMessage) Marshal() []byte

func (*ShellReadyMessage) UnmarshalFromAgentMessage

func (c *ShellReadyMessage) UnmarshalFromAgentMessage(data []byte) error

type ShellResizeMessage

type ShellResizeMessage struct {
	SessionID [16]byte
	Rows      uint16
	Cols      uint16
}

func (*ShellResizeMessage) ID

func (c *ShellResizeMessage) ID() string

func (ShellResizeMessage) Marshal

func (c ShellResizeMessage) Marshal() []byte

func (*ShellResizeMessage) UnmarshalFromAgentMessage

func (c *ShellResizeMessage) UnmarshalFromAgentMessage(data []byte) error

Jump to

Keyboard shortcuts

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