Documentation ¶
Overview ¶
Package calendar provides a Google Calendar barista module.
Index ¶
- Constants
- type Event
- type EventList
- type Module
- func (m *Module) CalendarID(id string) *Module
- func (m *Module) Output(outputFunc func(EventList) bar.Output) *Module
- func (m *Module) RefreshInterval(interval time.Duration) *Module
- func (m *Module) ShowDeclined(show bool) *Module
- func (m *Module) Stream(sink bar.Sink)
- func (m *Module) TimeWindow(window time.Duration) *Module
- type Status
Constants ¶
const ( StatusUnknown = Status("") StatusConfirmed = Status("confirmed") StatusTentative = Status("tentative") StatusCancelled = Status("cancelled") StatusDeclined = Status("declined") StatusUnresponded = Status("needsAction") )
Possible values for status per the calendar API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { Start time.Time End time.Time Alert time.Time EventStatus Status Response Status Location string Summary string }
Event represents a calendar event.
func (Event) UntilAlert ¶
UntilAlert returns the time remaining until a notification should be displayed for this event.
func (Event) UntilStart ¶
UntilStart returns the time remaining until the event starts.
type EventList ¶
type EventList struct { // All events currently in progress InProgress []Event // Events where the time until start is less than the notification duration Alerting []Event // All other future events Upcoming []Event }
EventList represents the list of events split by the temporal state of each event: in progress, alerting (upcoming but within notification duration), or upcoming beyond the notification duration.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module represents a Google Calendar barista module.
func (*Module) CalendarID ¶
CalendarID sets the ID of the calendar to fetch events for.
func (*Module) RefreshInterval ¶
RefreshInterval sets the interval for fetching new events. Note that this is distinct from the rendering interval, which is returned by the output func on each new output.
func (*Module) ShowDeclined ¶
ShowDeclined controls whether declined events are shown or ignored.