Documentation
¶
Index ¶
Constants ¶
const ( // CueNotification indicates that a specific cue has been triggered. CueNotification = "cue" // PeriodicNotification indicates that the periodic timer has elapsed. PeriodicNotification = "periodic" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Announcement ¶
type Announcement struct {
// Cause indicates the reason for the announcement. Valid reasons are "periodic" and "cue"
Cause string `json:"cause"`
// TimePoints lists the TimePoints (cues and their time offsets) which have been received so far, in order of appearance.
TimePoints []*TimePoint `json:"time_points"`
}
An Announcement is a notification of a change in the showtime. It can be an incremental time notification or a cue notification
type Service ¶
type Service struct {
Echo *echo.Echo
// Times records the Cues as they are received
Times []*Time
// contains filtered or unexported fields
}
Service describes a live performance time service
func (*Service) Subscribe ¶
func (s *Service) Subscribe() *Subscription
Subscribe registers a subscription to receive showtime announcements
type Subscription ¶
type Subscription struct {
C chan *Announcement
// contains filtered or unexported fields
}
Subscription represents a subscription to showtime announcements
func (*Subscription) Cancel ¶
func (s *Subscription) Cancel()
Cancel cancels the subscription and removes it from the service
type Time ¶
type Time struct {
// Cue indicates the last-triggered performance cue
Cue string
// Received indicates the timestamp at which the last-triggered cue was received
Received time.Time
}
Time describes the time at which the last Cue occurred
func (*Time) OffsetSeconds ¶
OffsetSeconds returns the time elapsed since the associated cue was triggered.
type TimePoint ¶
type TimePoint struct {
// Cue indicates the last-triggered performance cue
Cue string `json:"cue"`
// Offset indicates the number of seconds since the last cue was triggered
Offset float64 `json:"offset"`
}
TimePoint describes a point in performance time, which can be exported to the web clients. It uses an offset rather than a timestamp so that web clients need not be time-synchronized to the server.