Documentation ¶
Overview ¶
MIT License
Copyright (c) 2020 Julien LE THENO ¶
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 ¶
Copyright (c) 2020 Julien LE THENO ¶
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 ¶
- func Connect() (*calendar.Service, error)
- func CopyActivityFromID(EventID string, startTime time.Time, srv *calendar.Service) (err error)
- func DeleteActivity(activity *calendar.Event, srv *calendar.Service) (err error)
- func DeleteActivityFromID(EventID string, srv *calendar.Service) (err error)
- func GetActivitiesBetweenDates(beginDate string, endDate string, srv *calendar.Service) (cals *calendar.Events, err error)
- func GetColorIDFromColorName(colorName string) (colorID string, err error)
- func GetColorNameForEventID(ID string, srv *calendar.Service) (string, error)
- func GetColorNameFromColorID(colorID string) (colorName string, err error)
- func GetDuration(activity *calendar.Event) (string, error)
- func GetEndDateForEventID(ID string, srv *calendar.Service) (time.Time, error)
- func GetLastEvent(srv *calendar.Service) (calendar.Event, error)
- func GetStartDateForEventID(ID string, srv *calendar.Service) (time.Time, error)
- func InsertActivity(name string, color string, beginTime time.Time, endTime time.Time, ...) (activity calendar.Event, err error)
- func MoveActivityFromID(EventID string, startTime time.Time, srv *calendar.Service) (err error)
- func RenameActivity(activity *calendar.Event, text string, srv *calendar.Service) (err error)
- func RenameActivityByID(eventID string, text string, srv *calendar.Service) (err error)
- func StopActivity(activity *calendar.Event, srv *calendar.Service) (err error)
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 ¶
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 ¶
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 ¶
GetColorIDFromColorName TODO
func GetColorNameForEventID ¶
GetColorNameForEventID returns the color name of a event given its ID
func GetColorNameFromColorID ¶
GetColorNameFromColorID TODO
func GetDuration ¶
GetDuration Retrieve the duration (now - startTime) of current event
func GetEndDateForEventID ¶
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 ¶
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 ¶
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 ¶
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 ¶
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.