Documentation ¶
Overview ¶
Package drivefs contains helper functions to interact with Google Drive
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenewRefreshTokenForAccount ¶
func RenewRefreshTokenForAccount(ctx context.Context, cr *chrome.Chrome, oauthCredentials string) (string, error)
RenewRefreshTokenForAccount obtains a new OAuth refresh token for an account logged in on the chrome.Chrome instance. This is used by filemanager.DrivefsNewRefreshTokens test to easily obtain a set of new refresh tokens for the pooled GAIA logins.
Types ¶
type APIClient ¶
type APIClient struct {
// contains filtered or unexported fields
}
APIClient contains the stored client and Drive API service.
func CreateAPIClient ¶
func CreateAPIClient(ctx context.Context, cr *chrome.Chrome, oauthCredentials, refreshToken string) (*APIClient, error)
CreateAPIClient is a factory method that authorizes the logged in user. The factory returns a APIClient type that has helper methods to perform Drive API tasks.
func (*APIClient) CreateBlankGoogleDoc ¶
func (d *APIClient) CreateBlankGoogleDoc(ctx context.Context, fileName string, dirPath []string) (*drive.File, error)
CreateBlankGoogleDoc creates a google doc with supplied filename in the directory path. All paths should start with root unless they are team drives, in which case the drive path.
type FixtureData ¶
type FixtureData struct { // Chrome is a connection to an already-started Chrome instance. // It cannot be closed by tests. Chrome *chrome.Chrome // The path that DriveFS has mounted at. MountPath string // The API connection to the Test extension, reused by tests. TestAPIConn *chrome.TestConn // The APIClient singleton. APIClient *APIClient }
FixtureData is the struct available for tests.