Help us shape the future of Go! Take the 2026 Go Developer Survey

calendar

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetCalendarEventsArgs

type GetCalendarEventsArgs struct {
	ShowDeleted  *bool
	SingleEvents *bool
	TimeZone     string
	TimeMin      string
	TimeMax      string
	UpdatedMin   string
}

type GoogleCalendar

type GoogleCalendar struct {
	Oauth2Config *oauth2.Config
	Ctx          context.Context
}
func (gc *GoogleCalendar) GetAuthLink(state string) string

func (*GoogleCalendar) GetCalendarEvents

func (gc *GoogleCalendar) GetCalendarEvents(token *oauth2.Token, calendarID string, args *GetCalendarEventsArgs) ([]*calendar.Event, error)

func (*GoogleCalendar) GetCalendars

func (gc *GoogleCalendar) GetCalendars(token *oauth2.Token) ([]*calendar.CalendarListEntry, error)

func (*GoogleCalendar) GetStateCodeFromGin

func (gc *GoogleCalendar) GetStateCodeFromGin(c *gin.Context) (string, string, error)

func (*GoogleCalendar) GetTokenFromCode

func (gc *GoogleCalendar) GetTokenFromCode(code string) (*oauth2.Token, error)

func (*GoogleCalendar) RefreshToken

func (gc *GoogleCalendar) RefreshToken(token *oauth2.Token) (bool, *oauth2.Token, error)

RefreshToken refreshes the token if it's expired otherwise it returns the same token useful for updating token inside your database when it's refreshed

func (*GoogleCalendar) UpsertEvent

func (gc *GoogleCalendar) UpsertEvent(token *oauth2.Token, calendarID string, event *calendar.Event) (*calendar.Event, error)

type ICalendar

type ICalendar interface {
	GetAuthLink(state string) string
	GetStateCodeFromGin(c *gin.Context) (string, string, error)
	GetTokenFromCode(code string) (*oauth2.Token, error)
	RefreshToken(token *oauth2.Token) (bool, *oauth2.Token, error)
	GetCalendars(token *oauth2.Token) ([]*calendar.CalendarListEntry, error)
	GetCalendarEvents(token *oauth2.Token, calendarID string, args *GetCalendarEventsArgs) ([]*calendar.Event, error)
	UpsertEvent(token *oauth2.Token, calendarID string, event *calendar.Event) (*calendar.Event, error)
}

func NewGoogleCalendar

func NewGoogleCalendar(configService config.IConfig) (ICalendar, error)

type NewCalendarFunc

type NewCalendarFunc func(configService config.IConfig) (ICalendar, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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