Help us shape the future of Go! Take the 2026 Go Developer Survey

agent

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Code generated by ./hack/generate-agent-binaries DO NOT EDIT

Index

Constants

This section is empty.

Variables

View Source
var AgentBinary_linux_amd64_ []byte
View Source
var AgentBinary_linux_arm64_ []byte

Functions

func AddLogger

func AddLogger(agent *Agent) *slog.Logger

func Call

func Call[I any, O any](agent *Agent, call rpc.RPCCall[I]) (rpc.RPCResult[O], error)

func Connect

func Connect(agent *Agent) error

func Disconnect

func Disconnect(agent *Agent) error

func GetAgentBinary

func GetAgentBinary(goos string, goarch string) ([]byte, error)

func InstallAgent

func InstallAgent(agent *Agent) error

func RunRemoteCommand

func RunRemoteCommand(agent *Agent, cmd string) ([]byte, error)

Types

type Agent

type Agent struct {
	Mutex     sync.Mutex
	Client    *ssh.Client
	Session   *ssh.Session
	Encoder   *json.Encoder
	Decoder   *json.Decoder
	Running   *atomic.Bool
	WaitGroup *sync.WaitGroup
	InFlight  *syncmap.Map[string, chan rpc.RPCResult[any]]
	Logger    *slog.Logger
}

func (*Agent) Disconnect

func (agent *Agent) Disconnect() error

Directories

Path Synopsis
cmd
mid-agent command

Jump to

Keyboard shortcuts

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