Example #1
0
func NewCachedSyncer(t *oauth.Transport, metaService *metadata.MetaService, blobManager *blob.Manager) *CachedSyncer {
	driveService, _ := client.New(t.Client())
	return &CachedSyncer{
		downloader:    NewDownloader(t.Client(), metaService, blobManager),
		remoteService: driveService,
		metaService:   metaService,
	}
}
Example #2
0
func listFolders(tr *oauth.Transport) {
	svc, err := drive.New(tr.Client())
	if err != nil {
		logger.F(err)
	}
	q := "mimeType='application/vnd.google-apps.folder' and trashed=false"
	// TODO: pagination.
	files, err := svc.Files.List().Q(q).Do()
	if err != nil {
		logger.F(err)
	}
	for _, f := range files.Items {
		fmt.Println(f.Title, f.Id)
	}
}