calendar

package
v0.0.0-...-7e6db5d Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndTime

func EndTime(e *calendar.Event) time.Time

func FirstEvent

func FirstEvent(events ...*calendar.Event) *calendar.Event

func StartTime

func StartTime(e *calendar.Event) time.Time

Types

type Calendar

type Calendar struct {
	*calendar.Service
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCalendar

func NewCalendar(ctx context.Context, googleCfg *oauth2.Config, refreshToken string) (*Calendar, error)

func (*Calendar) AddEvent

func (cal *Calendar) AddEvent(creator, title, description string, start time.Time, duration time.Duration) error

func (*Calendar) CalendarIDs

func (cal *Calendar) CalendarIDs() []string

func (*Calendar) CalendarIDsMatching

func (cal *Calendar) CalendarIDsMatching(query string) []string

func (*Calendar) List

func (cal *Calendar) List() []string

func (*Calendar) OngoingEvents

func (cal *Calendar) OngoingEvents() ([]*calendar.Event, error)

func (*Calendar) Query

func (cal *Calendar) Query(query string, amount int64) ([]*calendar.Event, error)

returns a list of all events that are ongoing or happenign in the future, sorted by starting time

func (*Calendar) QueryCalendarSingle

func (cal *Calendar) QueryCalendarSingle(query, calID string, mods ...func(c *calendar.EventsListCall)) (*calendar.Event, error)

func (*Calendar) QueryCalendarTitles

func (cal *Calendar) QueryCalendarTitles(query string) (*calendar.Event, error)

func (*Calendar) QueryCalendars

func (cal *Calendar) QueryCalendars(query string, mods ...func(c *calendar.EventsListCall)) ([]*calendar.Event, error)

func (*Calendar) Refresh

func (cal *Calendar) Refresh()

Jump to

Keyboard shortcuts

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