Documentation
¶
Overview ¶
Package message provides relay, broadcast, read, report-back, and worker enumeration.
Index ¶
- Constants
- type BroadcastResult
- type Service
- func (s *Service) Broadcast(ctx context.Context, masterID, message string) (BroadcastResult, error)
- func (s *Service) BroadcastFrom(ctx context.Context, senderID, masterID, message string) (BroadcastResult, error)
- func (s *Service) Read(ctx context.Context, workerID string, lines int) (string, error)
- func (s *Service) Relay(ctx context.Context, workerID, message string) error
- func (s *Service) RelayFrom(ctx context.Context, senderID, targetID, message string) error
- func (s *Service) Report(ctx context.Context, sessionID, message string) error
- func (s *Service) Workers(ctx context.Context, masterID string) ([]WorkerInfo, error)
- type WorkerInfo
Constants ¶
View Source
const LargeMessageThreshold = 200
LargeMessageThreshold is the character count above which messages use file indirection.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BroadcastResult ¶
type BroadcastResult struct {
Registered int // total workers in manifest
Delivered int // workers that received the message
}
BroadcastResult distinguishes "no registered workers" from "registered but none reachable."
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides messaging operations between questmaster sessions.
func NewService ¶
NewService creates a messaging service.
func (*Service) BroadcastFrom ¶
func (s *Service) BroadcastFrom(ctx context.Context, senderID, masterID, message string) (BroadcastResult, error)
BroadcastFrom sends a message with sender provenance to all workers of a master session.
func (*Service) RelayFrom ¶
RelayFrom sends a message to a worker's primary pane with sender provenance.
type WorkerInfo ¶
type WorkerInfo struct {
SessionID string `json:"session_id"`
Status string `json:"status"`
Title string `json:"title"`
}
WorkerInfo holds status information for a worker session.
Click to show internal directories.
Click to hide internal directories.