google_agenda_api

package
v0.0.0-...-6520477 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect() (*calendar.Service, error)

Connect to the google agenda endpoint. Will set up automatically the credentials if they dont exist yet return Calendar service pointer to have access to the calendar

func CopyActivityFromID

func CopyActivityFromID(EventID string, startTime time.Time, srv *calendar.Service) (err error)

CopyActivityFromID : Copy the activity with the datetime given in parareters Set the start time to the one in param, and stop time will be changed accordingly to keep the same duration

func DeleteActivity

func DeleteActivity(activity *calendar.Event, srv *calendar.Service) (err error)

DeleteActivity : Deletes the activity given in parameters Also give a pointer the the calendar service in order to send the api.

func DeleteActivityFromID

func DeleteActivityFromID(EventID string, srv *calendar.Service) (err error)

DeleteActivityFromID : Deletes the activity related to the idgiven in parameters Also give a pointer the the calendar service in order to send the api.

func GetActivitiesBetweenDates

func GetActivitiesBetweenDates(beginDate string, endDate string, srv *calendar.Service) (cals *calendar.Events, err error)

GetActivitiesBetweenDates Retrieve a Events* list of events which occurs between the dates given in parameters (in format RFC3339) Also give a pointer the the calendar service in order to send the api.

func GetColorIDFromColorName

func GetColorIDFromColorName(colorName string) (colorID string, err error)

GetColorIDFromColorName TODO

func GetColorNameForEventID

func GetColorNameForEventID(ID string, srv *calendar.Service) (string, error)

GetColorNameForEventID returns the color name of a event given its ID

func GetColorNameFromColorID

func GetColorNameFromColorID(colorID string) (colorName string, err error)

GetColorNameFromColorID TODO

func GetDuration

func GetDuration(activity *calendar.Event) (string, error)

GetDuration Retrieve the duration (now - startTime) of current event

func GetEndDateForEventID

func GetEndDateForEventID(ID string, srv *calendar.Service) (time.Time, error)

GetEndDateForEventID returns the end date of a event given its ID

func GetLastEvent

func GetLastEvent(srv *calendar.Service) (calendar.Event, error)

GetLastEvent function gets the last event we set on google agenda today, in order to ask the user if he's still doing that task or not TODO : Use the newer getActivitiesBetweenDates instead

func GetStartDateForEventID

func GetStartDateForEventID(ID string, srv *calendar.Service) (time.Time, error)

GetStartDateForEventID returns the date of a event given its ID

func InsertActivity

func InsertActivity(name string, color string, beginTime time.Time, endTime time.Time, srv *calendar.Service) (activity calendar.Event, err error)

InsertActivity : Inserts an activity in the agenda with the name of the event and the color of the event you want, the start and end time colors can be : "red", "yellow", "purple", "orange", "blue" Also give a pointer the the calendar service in order to send the api. It will return, if it succeeds, the event created, and an error code in case it fails.

func MoveActivityFromID

func MoveActivityFromID(EventID string, startTime time.Time, srv *calendar.Service) (err error)

MoveActivityFromID : Moves the activity with the datetime given in parareters Set the start time to the one in param, and stop time will be changed accordingly to keep the same duration

func RenameActivity

func RenameActivity(activity *calendar.Event, text string, srv *calendar.Service) (err error)

RenameActivity : Renames the activity given in parameters with the text parameter Also give a pointer the the calendar service in order to send the api.

func RenameActivityByID

func RenameActivityByID(eventID string, text string, srv *calendar.Service) (err error)

RenameActivityByID : Renames the activity given in parameters with the text parameter Also give a pointer the the calendar service in order to send the api.

func StopActivity

func StopActivity(activity *calendar.Event, srv *calendar.Service) (err error)

StopActivity : Stops the current activity : actually update the end time of the activity in parameters to be current time. Also give a pointer the the calendar service in order to send the api.

Types

This section is empty.

Jump to

Keyboard shortcuts

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