agentlink

package
v0.23.6 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConnectionInfo added in v0.23.0

func GetConnectionInfo() (server, token string, err error)

GetConnectionInfo retrieves connection information from the running agent Returns server URL and auth token

func IsAgentRunning added in v0.21.0

func IsAgentRunning() bool

func SendWithResponseMsg

func SendWithResponseMsg(commandType CommandType, payload interface{}, response interface{}) error

func StartCommandSocket

func StartCommandSocket(agentClientObj *agent_client.AgentClient)

func StopCommandSocket

func StopCommandSocket()

Types

type CommandMsg

type CommandMsg struct {
	Command CommandType `msgpack:"c"`
	Payload []byte      `msgpack:"p"`
}

func (*CommandMsg) Unmarshal

func (c *CommandMsg) Unmarshal(v interface{}) error

type CommandType

type CommandType int
const (
	CommandNil CommandType = iota
	CommandConnect
	CommandSpaceNote
	CommandSpaceSetField
	CommandSpaceGetField
	CommandSpaceStop
	CommandSpaceRestart
	CommandForwardPort
	CommandListPortForwards
	CommandStopPortForward
)

type ConnectResponse

type ConnectResponse struct {
	Success bool   `msgpack:"s"`
	Server  string `msgpack:"sv"`
	Token   string `msgpack:"t"`
	SpaceID string `msgpack:"sid"`
}

type ForwardPortRequest added in v0.22.0

type ForwardPortRequest struct {
	LocalPort  uint16 `json:"local_port" msgpack:"local_port"`
	Space      string `json:"space" msgpack:"space"`
	RemotePort uint16 `json:"remote_port" msgpack:"remote_port"`
}

type ListPortForwardsResponse added in v0.22.0

type ListPortForwardsResponse struct {
	Forwards []PortForwardInfo `json:"forwards" msgpack:"forwards"`
}

type PortForwardInfo added in v0.22.0

type PortForwardInfo struct {
	LocalPort  uint16 `json:"local_port" msgpack:"local_port"`
	Space      string `json:"space" msgpack:"space"`
	RemotePort uint16 `json:"remote_port" msgpack:"remote_port"`
}

type RunCommandRequest added in v0.19.0

type RunCommandRequest struct {
	Command string `json:"command" msgpack:"command"`
	Timeout int    `json:"timeout" msgpack:"timeout"`
	Workdir string `json:"workdir" msgpack:"workdir"`
}

type RunCommandResponse added in v0.19.0

type RunCommandResponse struct {
	Success bool   `json:"success" msgpack:"success"`
	Error   string `json:"error" msgpack:"error"`
}

type SpaceFieldRequest added in v0.21.5

type SpaceFieldRequest struct {
	Name  string `json:"name" msgpack:"name"`
	Value string `json:"value" msgpack:"value"`
}

type SpaceGetFieldRequest added in v0.21.5

type SpaceGetFieldRequest struct {
	Name string `json:"name" msgpack:"name"`
}

type SpaceGetFieldResponse added in v0.21.5

type SpaceGetFieldResponse struct {
	Value string `json:"value" msgpack:"value"`
}

type SpaceNoteRequest

type SpaceNoteRequest struct {
	Note string `json:"note" msgpack:"note"`
}

type StopPortForwardRequest added in v0.22.0

type StopPortForwardRequest struct {
	LocalPort uint16 `json:"local_port" msgpack:"local_port"`
}

Jump to

Keyboard shortcuts

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