server

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, startTime time.Time, plugins []string) error

Run performs a single connection lifecycle: dial → register → ack → loops. Returns nil only when ctx is cancelled (clean shutdown).

func RunForever

func RunForever(ctx context.Context, startTime time.Time, plugins []string)

RunForever wraps Run with reconnect logic. It blocks until ctx is cancelled. Backoff strategy per proto.md §7:

  • Normal disconnect: 1s → 2s → ... → 300s, ±25% jitter
  • Auth failure (401): 60s → 120s → ... → 1800s, ±25% jitter

Types

type Conn

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

Conn manages one WebSocket connection to catpaw-server.

type Message

type Message struct {
	Type    string          `json:"type"`
	ID      string          `json:"id"`
	RefID   string          `json:"ref_id,omitempty"`
	Payload json.RawMessage `json:"payload,omitempty"`
}

Message is the protocol envelope for all Agent <-> Server communication.

Jump to

Keyboard shortcuts

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