/cloud-storage

This package work with Google Drive, Dropbox, OneDrive and Sharepoint

Primary LanguageGo

Cloud Storage Service

import "github.com/golang-common-packages/cloud-storage"
cloudStorageConfig := &cloudStorage.Config {
		URL:          "",
		Username:     "",
		Password:     "",
		AccessToken:  "",
		RefreshToken: "",
}
googleDrive := cloudStorage.NewFilestore(cloudStorage.DRIVE, cloudStorageConfig),
dropBox := cloudStorage.NewFilestore(cloudStorage.DROPBOX, cloudStorageConfig),
oneDrive := cloudStorage.NewFilestore(cloudStorage.ONEDRIVE, cloudStorageConfig),
sharePoint := cloudStorage.NewFilestore(cloudStorage.SHAREPOINT, cloudStorageConfig),
fileInfo := &cloudStorage.FileModel {
			ParentID:      "",
			SourcesID:     "",
			DestinationID: "",
			Source:        "",
			Sources:       nil,
			Destination:   "",
			Destinations:  nil,
			Name:          "",
			MimeType:      "",
			Path:          "",
			Content:       nil,
			Query:         "",
}
googleDrive.List(fileInfo)
googleDrive.Upload(fileInfo)
googleDrive.Download(fileInfo)
googleDrive.Delete(fileInfo)
...

Note

Check this template for more information and know how to use this service