Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentFatalEvent ¶
type AgentFatalEvent struct {
Reason string
// contains filtered or unexported fields
}
func NewAgentFatal ¶
func NewAgentFatal(id string, at time.Time, reason string) AgentFatalEvent
func (AgentFatalEvent) EventType ¶
func (AgentFatalEvent) EventType() Type
type BackpressureStallEvent ¶
type BackpressureStallEvent struct {
Endpoint string
WALSize uint64
WALSizeMax uint64
DroppedMsgs int
// contains filtered or unexported fields
}
func NewBackpressureStall ¶
func (BackpressureStallEvent) EventType ¶
func (BackpressureStallEvent) EventType() Type
type Bus ¶
type Bus interface {
Publish(e Event)
Subscribe(filter Filter) Subscription
}
Bus is the publish/subscribe API for cliwrap events.
Publish is non-blocking. Subscribe returns a Subscription whose Events channel the caller must either drain or Close. Slow subscribers are disconnected after repeated drops by the underlying implementation.
type CrashContext ¶
type CrashContext struct {
Source string
AgentExit int
AgentSig int
ChildExit int
ChildSig int
Reason string
}
CrashContext summarizes the unified crash information reported to subscribers. It mirrors controller.CrashInfo without creating an import cycle.
type Event ¶
type Event interface {
EventType() Type
ProcessID() string
Timestamp() time.Time
// contains filtered or unexported methods
}
Event is implemented by every concrete event type in this package. External packages can only consume events; they cannot implement Event.
type Filter ¶
Filter is applied by the bus to decide which events a subscriber receives. Empty slices mean "any" — a zero-value Filter matches all events.
type LogChunkEvent ¶
func NewLogChunk ¶
func (LogChunkEvent) EventType ¶
func (LogChunkEvent) EventType() Type
type LogOverflowEvent ¶
type LogOverflowEvent struct {
Reason string
// contains filtered or unexported fields
}
func NewLogOverflow ¶
func NewLogOverflow(id string, at time.Time, reason string) LogOverflowEvent
func (LogOverflowEvent) EventType ¶
func (LogOverflowEvent) EventType() Type
type ProcessCrashedEvent ¶
type ProcessCrashedEvent struct {
CrashContext CrashContext
WillRestart bool
NextAttemptIn time.Duration
// contains filtered or unexported fields
}
func NewProcessCrashed ¶
func NewProcessCrashed(id string, at time.Time, c CrashContext, willRestart bool, backoff time.Duration) ProcessCrashedEvent
func (ProcessCrashedEvent) EventType ¶
func (ProcessCrashedEvent) EventType() Type
type ProcessStartedEvent ¶
type ProcessStartedEvent struct {
AgentPID int
ChildPID int
// contains filtered or unexported fields
}
func NewProcessStarted ¶
func NewProcessStarted(id string, at time.Time, agentPID, childPID int) ProcessStartedEvent
func (ProcessStartedEvent) EventType ¶
func (ProcessStartedEvent) EventType() Type
type ProcessStartingEvent ¶
type ProcessStartingEvent struct {
// contains filtered or unexported fields
}
func NewProcessStarting ¶
func NewProcessStarting(id string, at time.Time) ProcessStartingEvent
func (ProcessStartingEvent) EventType ¶
func (ProcessStartingEvent) EventType() Type
type ProcessStoppedEvent ¶
type ProcessStoppedEvent struct {
ExitCode int
// contains filtered or unexported fields
}
func NewProcessStopped ¶
func NewProcessStopped(id string, at time.Time, exitCode int) ProcessStoppedEvent
func (ProcessStoppedEvent) EventType ¶
func (ProcessStoppedEvent) EventType() Type
type Subscription ¶
Subscription represents one active subscription. Close releases the underlying channel and goroutine references.
type Type ¶
type Type string
Type identifies an event kind.
const ( TypeProcessRegistered Type = "process.registered" TypeProcessStarting Type = "process.starting" TypeProcessStarted Type = "process.started" TypeProcessStopping Type = "process.stopping" TypeProcessStopped Type = "process.stopped" TypeProcessCrashed Type = "process.crashed" TypeProcessRestarting Type = "process.restarting" TypeProcessFailed Type = "process.failed" TypeAgentSpawned Type = "agent.spawned" TypeAgentFatal Type = "agent.fatal" TypeAgentDisconnected Type = "agent.disconnected" TypeLogChunk Type = "log.chunk" TypeLogFileRef Type = "log.file_ref" TypeLogOverflow Type = "log.overflow" TypeBackpressureStall Type = "reliability.backpressure_stall" TypeShutdownRequested Type = "system.shutdown_requested" TypeShutdownIncomplete Type = "system.shutdown_incomplete" )
Defined event types.