Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllScopes = []string{
"https://www.googleapis.com/auth/gmail.readonly",
"https://www.googleapis.com/auth/gmail.send",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/calendar.readonly",
"https://www.googleapis.com/auth/calendar.events",
"https://www.googleapis.com/auth/drive.readonly",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/documents.readonly",
"https://www.googleapis.com/auth/documents",
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/presentations.readonly",
"https://www.googleapis.com/auth/presentations",
"https://www.googleapis.com/auth/tasks.readonly",
"https://www.googleapis.com/auth/tasks",
"https://www.googleapis.com/auth/chat.spaces.readonly",
"https://www.googleapis.com/auth/chat.messages",
"https://www.googleapis.com/auth/chat.messages.create",
"https://www.googleapis.com/auth/forms.responses.readonly",
"https://www.googleapis.com/auth/userinfo.email",
}
AllScopes contains all Google API scopes required by gws. We request all scopes upfront so users only need to authenticate once.
Functions ¶
func GetTokenSource ¶
func GetTokenSource(ctx context.Context, clientID, clientSecret string, token *oauth2.Token) oauth2.TokenSource
GetTokenSource returns a token source that automatically refreshes the token.
Types ¶
type OAuthClient ¶
type OAuthClient struct {
// contains filtered or unexported fields
}
OAuthClient handles the OAuth2 authentication flow.
func NewOAuthClient ¶
func NewOAuthClient(clientID, clientSecret string) *OAuthClient
NewOAuthClient creates a new OAuth client with the given credentials.
func (*OAuthClient) GetConfig ¶
func (c *OAuthClient) GetConfig() *oauth2.Config
GetConfig returns the OAuth2 config for creating authenticated clients.
Click to show internal directories.
Click to hide internal directories.