Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CalendarClientInterface ¶ added in v1.0.19
type CalendarClientInterface interface {
// ListCalendars returns all calendars the user has access to
ListCalendars() ([]*calendar.CalendarListEntry, error)
// ListEvents returns events from the specified calendar within the given time range
ListEvents(calendarID string, timeMin, timeMax string, maxResults int64) ([]*calendar.Event, error)
// GetEvent retrieves a single event by ID
GetEvent(calendarID, eventID string) (*calendar.Event, error)
}
CalendarClientInterface defines the interface for Calendar client operations. This enables unit testing through mock implementations.
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 ¶
Client wraps the Google Calendar API service
func (*Client) ListCalendars ¶
func (c *Client) ListCalendars() ([]*calendar.CalendarListEntry, error)
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