Documentation
¶
Overview ¶
Package inbox provides a file-based message inbox for piglet. External processes drop JSON envelopes into a directory; the scanner picks them up and injects them into the agent loop.
Index ¶
Constants ¶
View Source
const ( DefaultScanInterval = 750 * time.Millisecond HeartbeatInterval = 2 * time.Second MaxFileBytes = 32 * 1024 MaxTextRunes = 8000 DedupCap = 1000 AckMaxAge = time.Hour PruneInterval = time.Minute ModeQueue = "queue" ModeInterrupt = "interrupt" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Ack ¶
type Ack struct {
ID string `json:"id"`
Status string `json:"status"`
Reason string `json:"reason,omitzero"`
Ts string `json:"ts"`
}
Ack is written after processing an envelope.
type Deliverer ¶
Deliverer injects messages into the agent loop. *sdk.Extension satisfies this interface.
type Envelope ¶
type Envelope struct {
Version int `json:"version"`
ID string `json:"id"`
Text string `json:"text"`
Mode string `json:"mode,omitzero"`
Created string `json:"created,omitzero"`
TTL int `json:"ttl,omitzero"`
Source string `json:"source,omitzero"`
}
Envelope is an inbound message from an external process.
type Heartbeat ¶
type Heartbeat struct {
PID int `json:"pid"`
CWD string `json:"cwd"`
Started string `json:"started"`
Heartbeat string `json:"heartbeat"`
}
Heartbeat is written periodically to the registry.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner watches the inbox directory and delivers messages.
Click to show internal directories.
Click to hide internal directories.