Documentation
¶
Index ¶
- Variables
- func GetMyDrives(client *http.Client) error
- func NewClient(ctx context.Context, oauthConfig *OAuthConfig, token OAuthToken, ...) *http.Client
- func SetLogger(l Logger)
- func StartAuthentication(ctx context.Context, oauthConfig *OAuthConfig) (authURL string, codeVerifier string, err error)
- type DefaultLogger
- type Logger
- type OAuthConfig
- type OAuthToken
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrReauthRequired = errors.New("re-authentication required") ErrAccessDenied = errors.New("access denied") ErrRetryLater = errors.New("retry later") ErrInvalidRequest = errors.New("invalid request") ErrResourceNotFound = errors.New("resource not found") ErrConflict = errors.New("conflict") ErrQuotaExceeded = errors.New("quota exceeded") )
Sentinel errors
Functions ¶
func GetMyDrives ¶
GetMyDrives retrieves the drives information.
func NewClient ¶
func NewClient(ctx context.Context, oauthConfig *OAuthConfig, token OAuthToken, tokenRefreshCallback func(OAuthToken)) *http.Client
NewClient creates a new HTTP client with the given OAuth token.
func StartAuthentication ¶
func StartAuthentication( ctx context.Context, oauthConfig *OAuthConfig, ) (authURL string, codeVerifier string, err error)
StartAuthentication initiates the OAuth authentication process.
Types ¶
type DefaultLogger ¶
type DefaultLogger struct{}
func (DefaultLogger) Debug ¶
func (l DefaultLogger) Debug(v ...interface{})
The Debug method by default is empty
type OAuthConfig ¶
OAuthConfig represents an OAuth2 Config.
func GetOauth2Config ¶
func GetOauth2Config(clientID string) (context.Context, *OAuthConfig)
GetOauth2Config returns the OAuth2 configuration.
type OAuthToken ¶
OAuthToken represents an OAuth2 Token.
func CompleteAuthentication ¶
func CompleteAuthentication( ctx context.Context, oauthConfig *OAuthConfig, code string, verifier string, ) (*OAuthToken, error)
CompleteAuthentication completes the OAuth authentication process.
Click to show internal directories.
Click to hide internal directories.