Documentation
¶
Overview ¶
Package gcal is a minimal Google Calendar API client using only the standard library: OAuth2 refresh-token auth, free/busy queries, and event creation with Google Meet conference links. Use the Login helper (or `anvil gcal-login`) once to obtain a refresh token for a Desktop-app OAuth client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Login ¶
func Login(ctx context.Context, clientID, clientSecret string, openURL func(string)) (string, error)
Login runs the OAuth2 installed-app loopback flow: starts a localhost listener, prints the consent URL, exchanges the code, and returns the refresh token. Use once per account, then store the token in config.
Types ¶
type Client ¶
type Client struct {
ClientID string
ClientSecret string
RefreshToken string
HTTP *http.Client
// Overridable in tests; defaults to the real Google endpoints.
TokenURL string
APIBase string
// contains filtered or unexported fields
}
Client calls the Google Calendar API for one account.
func (*Client) CreateEvent ¶
CreateEvent inserts an event. With meet true, Google attaches a Meet conference and the link is returned; attendees receive invitations (sendUpdates=all).