Documentation
¶
Index ¶
- type Event
- type EventType
- type Handler
- type Hub
- type JobRunBroadcaster
- func (b *JobRunBroadcaster) BroadcastJobRunCancelled(run *runs.JobRun)
- func (b *JobRunBroadcaster) BroadcastJobRunClaimed(run *runs.JobRun)
- func (b *JobRunBroadcaster) BroadcastJobRunCompleted(run *runs.JobRun)
- func (b *JobRunBroadcaster) BroadcastJobRunCreated(run *runs.JobRun)
- func (b *JobRunBroadcaster) BroadcastJobRunProgress(run *runs.JobRun)
- func (b *JobRunBroadcaster) BroadcastJobRunStarted(run *runs.JobRun)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Type EventType `json:"type"`
Payload map[string]interface{} `json:"payload"`
Timestamp time.Time `json:"timestamp"`
}
Event represents a websocket event to broadcast
func (*Event) MarshalJSON ¶
MarshalJSON marshals the event to JSON
type EventType ¶
type EventType string
EventType represents the type of event being broadcast
const ( EventJobRunCreated EventType = "job_run_created" EventJobRunUpdated EventType = "job_run_updated" EventJobRunClaimed EventType = "job_run_claimed" EventJobRunStarted EventType = "job_run_started" EventJobRunProgress EventType = "job_run_progress" EventJobRunCompleted EventType = "job_run_completed" EventJobRunCancelled EventType = "job_run_cancelled" )
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles websocket connections using Centrifuge
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub manages the centrifuge node and channels
func (*Hub) ClientCount ¶
ClientCount returns the number of connected clients
func (*Hub) Node ¶
func (h *Hub) Node() *centrifuge.Node
Node returns the underlying centrifuge node
type JobRunBroadcaster ¶
type JobRunBroadcaster struct {
// contains filtered or unexported fields
}
JobRunBroadcaster broadcasts job run events via websockets
func NewJobRunBroadcaster ¶
func NewJobRunBroadcaster(hub *Hub) *JobRunBroadcaster
NewJobRunBroadcaster creates a new job run broadcaster
func (*JobRunBroadcaster) BroadcastJobRunCancelled ¶
func (b *JobRunBroadcaster) BroadcastJobRunCancelled(run *runs.JobRun)
func (*JobRunBroadcaster) BroadcastJobRunClaimed ¶
func (b *JobRunBroadcaster) BroadcastJobRunClaimed(run *runs.JobRun)
func (*JobRunBroadcaster) BroadcastJobRunCompleted ¶
func (b *JobRunBroadcaster) BroadcastJobRunCompleted(run *runs.JobRun)
func (*JobRunBroadcaster) BroadcastJobRunCreated ¶
func (b *JobRunBroadcaster) BroadcastJobRunCreated(run *runs.JobRun)
func (*JobRunBroadcaster) BroadcastJobRunProgress ¶
func (b *JobRunBroadcaster) BroadcastJobRunProgress(run *runs.JobRun)
func (*JobRunBroadcaster) BroadcastJobRunStarted ¶
func (b *JobRunBroadcaster) BroadcastJobRunStarted(run *runs.JobRun)
Click to show internal directories.
Click to hide internal directories.