agent

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MPL-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package agent serializes authoritative state while utility work runs independently.

Index

Constants

This section is empty.

Variables

View Source
var Capabilities = []string{"native_xray", "multi_inbound", "tcp_udp_limits", "session_revocation", "traffic_ack", "certificates", "ddns", "smartdns", "geodata", "nftables", "port_forward", "metrics", "logs", "peer_speedtest", "torrent_ban", "signed_updates"}

Functions

This section is empty.

Types

type Agent

type Agent struct {
	Dir          string
	Version      string
	BootID       string
	Store        *state.Store
	Registry     *sessions.Registry
	Runtime      *xray.Runtime
	Client       *transport.Client
	Logs         *nlog.Stream
	Sampler      *monitor.Sampler
	Certificates *cert.Pool
	Firewall     *firewall.Manager
	Updater      *updatepkg.Manager
	Runner       host.Runner
	Jobs         *Jobs
	// contains filtered or unexported fields
}

func New

func New(dir, version string, client *transport.Client, logs *nlog.Stream) (*Agent, error)

func (*Agent) Run

func (a *Agent) Run(ctx context.Context) error

type JobResult

type JobResult struct {
	ID       string    `json:"id"`
	Command  string    `json:"command"`
	Status   string    `json:"status"`
	Data     any       `json:"data,omitempty"`
	Error    string    `json:"error,omitempty"`
	Finished time.Time `json:"finished,omitempty"`
}

type Jobs

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

func NewJobs

func NewJobs(dir string, send func(protocol.Message, bool) bool) *Jobs

func (*Jobs) Cancel

func (j *Jobs) Cancel(id string) bool

func (*Jobs) Snapshot

func (j *Jobs) Snapshot() []JobResult

func (*Jobs) Start

func (j *Jobs) Start(ctx context.Context, id, command string, fn func(context.Context, func(any)) (any, error)) error

Jump to

Keyboard shortcuts

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