gdriveLib

package
v0.0.0-...-4c75abf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Gapp = map[string]string{
	"gdoc":    "application/vnd.google-apps.document",
	"gsheet":  "application/vnd.google-apps.spreadsheet",
	"gdraw":   "application/vnd.google-apps.drawing",
	"gscript": "application/vnd.google-apps.script",
	"photo":   "application/vnd.google-apps.photo",
	"gslide":  "application/vnd.google-apps.presentation",
	"gmap":    "application/vnd.google-apps.map",
	"gform":   "application/vnd.google-apps.form",
	"folder":  "application/vnd.google-apps.folder",
	"file":    "application/vnd.google-apps.file",
	"jpg":     "image/jpeg",
	"png":     "image/png",
	"svg":     "image/svg+xml",
	"pdf":     "application/pdf",
	"html":    "text/html",
	"text":    "text/plain",
	"rich":    "application/rtf",
	"word":    "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
	"excel":   "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
	"csv":     "text/csv",
	"ppt":     "application/vnd.openxmlformats-officedocument.presentationml.presentation",
}

Functions

func ListApps

func ListApps()

Types

type FileInfo

type FileInfo struct {
	Id           string
	MimeType     string
	Name         string
	Ext          string
	ParentName   string
	ParentId     string
	SingleParent bool
	ModTime      string
	Size         int64
}

type GdApiObj

type GdApiObj struct {
	Ctx   context.Context
	GdSvc *drive.Service
}

func (*GdApiObj) CopyFile

func (gdrive *GdApiObj) CopyFile(filId string, nam string, dirId string) (nfilId string, err error)

func (*GdApiObj) CreDumpFile

func (gdrive *GdApiObj) CreDumpFile(fid string, filnam string) (err error)

func (*GdApiObj) CreateFile

func (gdrive *GdApiObj) CreateFile(pDirId string, nam string) (fileId string, err error)

func (*GdApiObj) CreateFolder

func (gdrive *GdApiObj) CreateFolder(pDirId string, nam string) (folderId string, err error)

func (*GdApiObj) CvtToFilInfo

func (gdrive *GdApiObj) CvtToFilInfo(fil *drive.File) (filinfoptr *FileInfo, err error)

func (*GdApiObj) DeleteFileById

func (gdrive *GdApiObj) DeleteFileById(filId string) (err error)

func (*GdApiObj) DeleteFileByName

func (gdrive *GdApiObj) DeleteFileByName(nam string) (err error)

func (*GdApiObj) DownloadFileById

func (gdrive *GdApiObj) DownloadFileById(filId string, fileName string) (err error)

func (*GdApiObj) DumpAbout

func (gdrive *GdApiObj) DumpAbout(about *drive.About, outfil *os.File) (err error)

func (*GdApiObj) DumpFileChar

func (gdrive *GdApiObj) DumpFileChar(inGfil *drive.File, outfil *os.File) (err error)

func (*GdApiObj) EmptyTrash

func (gdrive *GdApiObj) EmptyTrash() (err error)

func (*GdApiObj) ExportFile

func (gdrive *GdApiObj) ExportFile(inGfil *drive.File, outfil *os.File) (err error)

func (*GdApiObj) ExportFileById

func (gdrive *GdApiObj) ExportFileById(filId string, fileName string, ext string) (err error)

func (*GdApiObj) FetchFileById

func (gdrive *GdApiObj) FetchFileById(fid string) (resp *http.Response, err error)

func (*GdApiObj) GetAbout

func (gdrive *GdApiObj) GetAbout() (resp *drive.About, err error)

func (*GdApiObj) GetFileById

func (gdrive *GdApiObj) GetFileById(filId string) (fil *drive.File, err error)

func (*GdApiObj) GetFileByName

func (gdrive *GdApiObj) GetFileByName(nam string) (filesInfo *[]FileInfo, err error)

func (*GdApiObj) GetFileChar

func (gdrive *GdApiObj) GetFileChar(fid string) (gfil *drive.File, err error)

func (*GdApiObj) GetFileInfoById

func (gdrive *GdApiObj) GetFileInfoById(filId string) (filinfo *FileInfo, err error)

func (*GdApiObj) GetFullPath

func (gdrive *GdApiObj) GetFullPath(filId string) (filesInfo *[]FileInfo, path string, err error)

func (*GdApiObj) InitDriveApi

func (gdObj *GdApiObj) InitDriveApi() (err error)

func (*GdApiObj) ListAllFiles

func (gdrive *GdApiObj) ListAllFiles(dirId string) (fileList []*drive.File, err error)

func (*GdApiObj) ListFFByName

func (gdrive *GdApiObj) ListFFByName(nam string) (filList []*drive.File, err error)

func (*GdApiObj) ListFiles

func (gdrive *GdApiObj) ListFiles() (fileList []*drive.File, err error)

func (*GdApiObj) ListFilesByName

func (gdrive *GdApiObj) ListFilesByName(nam string, dirId string) (filList []*drive.File, err error)

func (*GdApiObj) ListFilesBySize

func (gdrive *GdApiObj) ListFilesBySize(foldId string, minSize int64) (filList []*drive.File, err error)

func (*GdApiObj) ListFolderByName

func (gdrive *GdApiObj) ListFolderByName(nam string) (folderList *[]FileInfo, err error)

func (*GdApiObj) ListFoldersByName

func (gdrive *GdApiObj) ListFoldersByName(nam string) (filList []*drive.File, err error)

func (*GdApiObj) ListTopDir

func (gdrive *GdApiObj) ListTopDir() (id string, err error)

func (*GdApiObj) MoveFileById

func (gdrive *GdApiObj) MoveFileById(filId string, dirId string) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL