gcalman

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAccessTokenFromAuthToken added in v0.0.2

func GenerateAccessTokenFromAuthToken(authTokenPath string, preferredAccessTokenPath string) error

Fetching Access Token *********************

  • Oauth token must be ready in advance, it needs to be fetched from Google developer console, https://developers.google.com/calendar/api/quickstart/go

  • Then you need to got "Enable API Wizard" to get your credentials, which you need to pass in authTokenPath

  • This function Generates Auth URL in STDOUT with instructions

  • Once AccessToken is provided as STDIN, it will be stored in the provided preferredAccessTokenPath

  • Once the tokens are saved to disk, we can Initialize this library using Init function

Types

type CreateEventResp added in v0.0.5

type CreateEventResp struct {
	Id          string
	HtmlLink    string
	HangoutLink string
}

type GcalEvent

type GcalEvent struct {
	Title          string
	Description    string
	AttendeeEmails []string
	Start          string
	End            string
	Location       string
	// This sends a calendar invite email to user
	SendInvite bool
	// By setting this flag, the event will appear in the calender of user as "AcceptedEvent"
	AcceptedEvent bool
}

type GcalMan

type GcalMan interface {
	CreateEvent(calId string, event *calendar.Event) (*CreateEventResp, error)
	BuildCalEventObject(calEvent *GcalEvent) *calendar.Event
	PrintEvents(calId string)
}

func Init

func Init(oauthToken string, accessToken string) (GcalMan, error)

Initialize GcalMan Object

- Details about fetching the auth/access token is provided in the documentation - Params: File path of oauthtoken and accesstoken

Jump to

Keyboard shortcuts

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