calendar

package
v0.0.0-...-5b019c4 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GOOGLE = "google"
)

Our appliance types

Variables

This section is empty.

Functions

func IsMeetingSoon

func IsMeetingSoon(event *calendar.Event) bool

IsMeetingSoon returns true if the meeting is less than 5 minutes from now.

func MeetingStartTime

func MeetingStartTime(event *calendar.Event) (time.Time, error)

MeetingStartTime returns the calendar event's start time.

func MeetingURLFromEvent

func MeetingURLFromEvent(event *calendar.Event) (*url.URL, bool)

MeetingURLFromEvent returns a URL if the event is a Zoom meeting.

Types

type GoogleCal

type GoogleCal struct {
	Provider string
	Client   *http.Client
	AuthURL  string
}

GoogleCal - Structure to hold stuff

func (*GoogleCal) GetAuthURL

func (p *GoogleCal) GetAuthURL() string

GetAuthURL - Return the AuthURL

func (*GoogleCal) GetClient

func (p *GoogleCal) GetClient() (bool, error)

GetClient - Apply DNS updates to Google DNS Hosted Zone

func (*GoogleCal) GetEvents

func (p *GoogleCal) GetEvents(num int64, attendee string) ([]MeetingEvent, error)

GetEvents - Return the next num events

func (*GoogleCal) GetToken

func (p *GoogleCal) GetToken() (*oauth2.Token, error)

GetToken - Get Oauth 2.0 Token

type MeetingEvent

type MeetingEvent struct {
	Description     string    `json:"description"`
	Start           time.Time `json:"start"`
	End             time.Time `json:"end"`
	MeetingProvider string    `json:"meetingprovider"`
	MeetingLink     url.URL   `json:"meetinglink"`
	IsMeetingSoon   bool      `json:"ismeetingsoon"`
	MeetingResponse string    `json:"meetingresponse"`
}

MeetingEvent - Structure that we care about returning

type Provider

type Provider interface {
	GetClient() (bool, error)
	GetEvents(num int64, attendee string) ([]MeetingEvent, error)
	GetAuthURL() string
	GetToken() (*oauth2.Token, error)
}

Provider = The main interface used to describe appliances

func GetProvider

func GetProvider(t string) (Provider, error)

GetProvider - Function to create the appliances

Jump to

Keyboard shortcuts

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