Documentation
¶
Overview ¶
Package calendar provides a client for the Google Calendar API.
Index ¶
- type CalendarInfo
- type Client
- func (c *Client) GetEvent(ctx context.Context, calendarID, eventID string) (*calendar.Event, error)
- func (c *Client) ListCalendars(ctx context.Context) ([]*calendar.CalendarListEntry, error)
- func (c *Client) ListEvents(ctx context.Context, calendarID string, timeMin, timeMax string, ...) ([]*calendar.Event, error)
- type Event
- type EventTime
- type Person
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CalendarInfo ¶
type CalendarInfo struct {
ID string `json:"id"`
Summary string `json:"summary"`
Description string `json:"description,omitempty"`
Primary bool `json:"primary"`
AccessRole string `json:"accessRole"`
TimeZone string `json:"timeZone,omitempty"`
}
CalendarInfo represents a simplified calendar for output
func ParseCalendar ¶
func ParseCalendar(c *calendar.CalendarListEntry) *CalendarInfo
ParseCalendar converts a Google Calendar API calendar entry to our simplified CalendarInfo
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the Google Calendar API service
func (*Client) ListCalendars ¶
ListCalendars returns all calendars the user has access to
type Event ¶
type Event struct {
ID string `json:"id"`
Summary string `json:"summary"`
Description string `json:"description,omitempty"`
Location string `json:"location,omitempty"`
Start *EventTime `json:"start"`
End *EventTime `json:"end"`
Status string `json:"status"`
HTMLLink string `json:"htmlLink,omitempty"`
HangoutLink string `json:"hangoutLink,omitempty"`
Organizer *Person `json:"organizer,omitempty"`
Attendees []Person `json:"attendees,omitempty"`
AllDay bool `json:"allDay"`
}
Event represents a simplified calendar event for output
func ParseEvent ¶
ParseEvent converts a Google Calendar API event to our simplified Event
func (*Event) FormatStartTime ¶
FormatStartTime returns a human-readable start time string
func (*Event) FormatTimeRange ¶
FormatTimeRange returns a human-readable time range string
func (*Event) GetEndTime ¶
GetEndTime returns the event end time as a time.Time
Click to show internal directories.
Click to hide internal directories.