gcal

package
v0.0.0-...-26575eb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Name       string
	Start, End time.Time
}

type EventDays

type EventDays map[time.Time]string

EventDays is a map that given a date returns the day type (La, Lb, Lx...).

type EventsMask

type EventsMask map[time.Time]bool

type GcalService

type GcalService interface {
	GetEventsList(calendarID string, timeMin, timeMax time.Time) (events *calendar.Events, err error)
}

type GoogleCalendar

type GoogleCalendar struct {
	// contains filtered or unexported fields
}

func NewGoogleCalendar

func NewGoogleCalendar() (cal *GoogleCalendar, err error)

func NewGoogleCalendarFromService

func NewGoogleCalendarFromService(srv GcalService) (cal *GoogleCalendar)

NewGoogleCalendarFromService used to give the calendar parser a different Google Calendar endpoint. Actually used for mockups.

func (*GoogleCalendar) GetCalendarDays

func (c *GoogleCalendar) GetCalendarDays(id string, timeMin, timeMax time.Time) (out []time.Time, err error)

GetCalendarDays returns a list of all days with an event in the calendar.

func (*GoogleCalendar) GetCalendarEventDays

func (c *GoogleCalendar) GetCalendarEventDays(id string, timeMin, timeMax time.Time) (out EventDays, err error)

GetCalendarEventDays returns a map that given a date, returns the event type (La, Lb...) that day belongs to.

func (*GoogleCalendar) GetCalendarEventMask

func (c *GoogleCalendar) GetCalendarEventMask(id string, timeMin, timeMax time.Time) (out EventsMask, err error)

GetCalendarEventMask returns a mask that given a day returns true if has an event.

func (*GoogleCalendar) GetCalendarEvents

func (c *GoogleCalendar) GetCalendarEvents(id string, timeMin, timeMax time.Time) (out []*Event, err error)

GetCalendarEvents returns a list of all events in the calendar.

func (*GoogleCalendar) GetYearCalendarEvents

func (c *GoogleCalendar) GetYearCalendarEvents(id string, year int) (out []*Event, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL