calendar_sync

package
v0.0.0-...-946f586 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(events []*Event, event *Event) bool

func Equals

func Equals(e1, e2 *Event) bool

func GetCampus

func GetCampus(campusName string) ([]string, error)

func Sync

func Sync(days int, googleCalendarClient *google_api.GoogleCalendar, kordisApi *kordis.KordisApi) error

func ToGoogleCalendarEvent

func ToGoogleCalendarEvent(event *Event) *calendar.Event

func ToGoogleCalendarEvents

func ToGoogleCalendarEvents(events []*Event) []*calendar.Event

Types

type Event

type Event struct {
	// Id: the id of the event in the calendar
	Id string `json:"id"`
	// StartDate: The start date of the event.
	StartDate time.Time `json:"startDate"`
	// EndDate: The end date of the event.
	EndDate time.Time `json:"endDate"`
	// Title: The title of the event.
	Title string `json:"title"`
	// Teacher: The teacher of the event.
	Teacher string `json:"teacher"`
	// Location: The location of the event.
	Location string `json:"location"`
	// Rooms: The rooms of the event.
	Rooms []*Room `json:"rooms"`
	// Event Color
	Color string `json:"color"`
}

func FromGoogleCalendarEvent

func FromGoogleCalendarEvent(event *calendar.Event) *Event

func FromGoogleCalendarEvents

func FromGoogleCalendarEvents(events []*calendar.Event) []*Event

func FromKordisEvent

func FromKordisEvent(event *kordis.AgendaEvent, c *carbon.Carbon) *Event

func FromKordisEvents

func FromKordisEvents(events []*kordis.AgendaEvent, c *carbon.Carbon) []*Event

func GetEventsToAdd

func GetEventsToAdd(kordisEvents []*Event, googleEvents []*Event) []*Event

func GetEventsToRemove

func GetEventsToRemove(kordisEvents []*Event, googleEvents []*Event) []*Event

type Room

type Room struct {
	Name   string `json:"name"`
	Campus string `json:"campus"`
}

Jump to

Keyboard shortcuts

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