예제 #1
0
파일: syncer.go 프로젝트: rakyll/drivefuse
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,
	}
}
예제 #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)
	}
}