googlecal

package
v0.0.0-...-69dacb3 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: LGPL-2.1 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CalendarConfig

type CalendarConfig map[DomainName]*jwt.Config

CalendarConfig config for calendar. Maps domains to configs

func ParseConfig

func ParseConfig(b []byte) (config CalendarConfig, err error)

ParseConfig parses config

func (*CalendarConfig) UnmarshalJSON

func (c *CalendarConfig) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON -

type CalendarConnector

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

CalendarConnector - base struct of dsl.

func NewCalendarConnector

func NewCalendarConnector(ctx context.Context, domain string) *CalendarConnector

NewCalendarConnector - create calendar connector

func (*CalendarConnector) AddParticipants

func (e *CalendarConnector) AddParticipants(eventID string, toAdd []string) error

AddParticipants adds users to an existing events participant list

func (*CalendarConnector) CreateEvent

func (e *CalendarConnector) CreateEvent(event global.Event) (eventID string, err error)

CreateEvent creates and uploads an event in Google Calendar based on contents of a global.Event struct

func (*CalendarConnector) DeleteEvent

func (e *CalendarConnector) DeleteEvent(eventID string) error

DeleteEvent deletes event with ID

func (*CalendarConnector) EventIsprivate

func (e *CalendarConnector) EventIsprivate(b *bool) *CalendarConnector

EventIsprivate - whether event is private or not

func (*CalendarConnector) GetCalendarEvent

func (e *CalendarConnector) GetCalendarEvent(ID string) (*calendar.Event, error)

GetCalendarEvent returns event by id. Returns calendar.Event type event.

func (*CalendarConnector) GetEvents

func (e *CalendarConnector) GetEvents(min string, max string, showDeleted bool) (
	*calendar.Events,
	error,
)

GetEvents returns event by id. Returns calendar.Event type event.

func (*CalendarConnector) GuestsAutoAccept

func (e *CalendarConnector) GuestsAutoAccept(b *bool) *CalendarConnector

GuestsAutoAccept - whether event is auto accepted by guests

func (*CalendarConnector) GuestsCanModify

func (e *CalendarConnector) GuestsCanModify(b *bool) *CalendarConnector

GuestsCanModify - whether guests can alter event

func (*CalendarConnector) GuestsMayInviteOthers

func (e *CalendarConnector) GuestsMayInviteOthers(b *bool) *CalendarConnector

GuestsMayInviteOthers - whether guests may invite others

func (*CalendarConnector) GuestsMaySeeOtherGuests

func (e *CalendarConnector) GuestsMaySeeOtherGuests(b *bool) *CalendarConnector

GuestsMaySeeOtherGuests - whether guests may see other guests

func (*CalendarConnector) InformGuestsAboutUpdates

func (e *CalendarConnector) InformGuestsAboutUpdates(b *bool) *CalendarConnector

InformGuestsAboutUpdates - whether mail should be sent on event change

func (*CalendarConnector) PatchEvent

func (e *CalendarConnector) PatchEvent(event global.Event) error

PatchEvent updates an existing event using patch semantics Note: Will not replace entire event, just specified fields.

func (*CalendarConnector) RemoveParticipants

func (e *CalendarConnector) RemoveParticipants(eventID string, toRemove []string) error

RemoveParticipants removes specified participants from an event

func (*CalendarConnector) UpdateEvent

func (e *CalendarConnector) UpdateEvent(event global.Event) error

UpdateEvent updates an existing event (overwrite) Note: Will overwrite any existing fields, as entire event object is replaced.

type DomainName

type DomainName string

DomainName name of domain

type UserError

type UserError error
var (
	ErrorMissingEventID      UserError = fmt.Errorf("missing event ID")
	ErrorMissingDates        UserError = fmt.Errorf("missing start or end date")
	ErrorMissingParticipants UserError = fmt.Errorf("no participants in event. must be at least one")
	ErrorBadLocation         UserError = fmt.Errorf("event has empty location")
	ErrorMissingTitle        UserError = fmt.Errorf("event has no title")
	ErrorUnknownDomain       UserError = fmt.Errorf("provided domain name unknown")
	ErrorBadID               UserError = fmt.Errorf("provided ID invalid, must be length 5 to 1024, and contain only lowercase letters and numbers 0-9")
)

Jump to

Keyboard shortcuts

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