utl

package
v1.7.5-0...-8012865 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package utl (appsscriptapi.go) : These methods are for using Apps Script API.

Package utl (convert.go) : This is a convereter to send GAS script to Google.

Package utl (dlfolders.go) : These methods are for downloading all files and folders from a folder in Google Drive.

Package utl (dlrevfile.go) : These methods are for retrieving revision ID and downloading revision files from Google Drive.

Package utl (fetcher.go) : These methods are for retrieving data from URL.

Package utl (getdriveinformation.go) : These method is for retrieving Drive Information.

Package utl (managepermissions.go) : These methods are for managing permissions of files and folders in Google Drive.

Package utl (resumableupload.go) : These methods are for Resumable Upload to Google Drive.

Package utl (searchfiles.go) : These methods are for searching files in Google Drive using search query and regex.

Package utl (transfer.go) : These methods are for downloading, uploading files and folders, and retrieving file list from or to Google Drive.

Package utl (zip.go) : These methods are for zipping files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChkExtention

func ChkExtention(ex string) bool

ChkExtention : Check extension of inputted files.

func ConvGasToPut

func ConvGasToPut(c *cli.Context) string

ConvGasToPut : Reads GAS source and formats it.

func ConvGasToRun

func ConvGasToRun(c *cli.Context) string

ConvGasToRun : Reads GAS source and formats it.

func ConvGasToUpload

func ConvGasToUpload(scriptfile string) string

ConvGasToUpload :

func ConvStringToRun

func ConvStringToRun(c *cli.Context, stringscript string) string

ConvStringToRun : Reads GAS source and formats it as a string script.

func DispScopeError1

func DispScopeError1()

DispScopeError1 : Display about new scope of 'https://www.googleapis.com/auth/script.projects'.

func DispScopeError2

func DispScopeError2(body []byte)

DispScopeError2 : Display about new scope of 'https://www.googleapis.com/auth/script.projects'.

func ExtToType

func ExtToType(ex string, uppercase bool) string

ExtToType : Convert extension to scripttype for project.

Types

type AppsScriptApiInf

type AppsScriptApiInf struct {
	ScriptId       string         `json:"scriptId"`
	ParentId       string         `json:"parentId"`
	Title          string         `json:"title"`
	CreateTime     time.Time      `json:"createTime"`
	UpdateTime     time.Time      `json:"updateTime"`
	Creator        creator        `json:"creator"`
	LastModifyUser lastmodifyuser `json:"lastModifyUser"`
}

AppsScriptApiInf : Information retrieved by Apps Script API

type FileInf

type FileInf struct {
	ProjectID         string            `json:"project_id,omitempty"`
	ParentID          string            `json:"parentId,omitempty"`
	RevisionID        string            `json:"revisionid,omitempty"`
	FileID            string            `json:"id,omitempty"`
	FileName          string            `json:"name,omitempty"`
	SaveName          string            `json:"saved_file_name,omitempty"`
	MimeType          string            `json:"mimeType,omitempty"`
	UpFilename        []string          `json:"upload_file_name,omitempty"`
	UpFileID          []string          `json:"uid,omitempty"`
	Parents           []string          `json:"parents,omitempty"`
	FileSize          string            `json:"size,omitempty"`
	WebLink           string            `json:"webContentLink,omitempty"`
	WebView           string            `json:"webViewLink,omitempty"`
	CreatedTime       *time.Time        `json:"createdTime,omitempty"`
	ModifiedTime      *time.Time        `json:"modifiedTime,omitempty"`
	UppedFiles        []uploadedFile    `json:"uploaded_files,omitempty"`
	LastModifyingUser *lastmodifieduser `json:"lastModifyingUser,omitempty"`
	Owners            []owners          `json:"owners,omitempty"`
	Msgar             []string          `json:"message,omitempty"`
	TotalEt           float64           `json:"TotalElapsedTime,omitempty"`
	FolderTree        *fileListDl       `json:"folderTreeWithFiles,omitempty"`
	SearchQuery       string            `json:"query,omitempty"`
	SearchFields      string            `json:"fields,omitempty"`
	SearchRegex       string            `json:"regex,omitempty"`
	SearchedFiles     []fileS           `json:"searchedFiles,omitempty"`
	SearchedResult    string            `json:"searchedResult,omitempty"`
	InputtedMimeType  []string          `json:"inputtedMimeType,omitempty"`
	ReturnedResult    interface{}       `json:"returnedResult,omitempty"`

	Accesstoken       string        `json:"-"`
	BoundScriptName   string        `json:"-"`
	ChunkSize         int64         `json:"-"`
	ConvertTo         string        `json:"-"`
	DlMime            string        `json:"-"`
	GoogleDocName     string        `json:"-"`
	OverWrite         bool          `json:"-"`
	PermissionInfo    permissionInf `json:"-"`
	Progress          bool          `json:"-"`
	ProjectType       string        `json:"-"`
	PstartTime        time.Time     `json:"-"`
	RawProject        bool          `json:"-"`
	SearchByName      string        `json:"-"`
	SearchByID        string        `json:"-"`
	ShowFileInf       bool          `json:"-"`
	Size              int64         `json:"-"`
	Skip              bool          `json:"-"`
	UseServiceAccount string        `json:"-"`
	WantExt           string        `json:"-"`
	WantName          string        `json:"-"`
	Workdir           string        `json:"-"`
	Zip               bool          `json:"-"`
}

FileInf : File information for downloading and uploading

func (*FileInf) ChkBoundOrStandalone

func (p *FileInf) ChkBoundOrStandalone(fileId string) ([]byte, error, bool)

ChkBoundOrStandalone : Check whether the fileId is a bound script or a standalone script.

func (*FileInf) DlFolders

func (p *FileInf) DlFolders() error

DlFolders : Main method for downloading folders

func (*FileInf) Downloader

func (p *FileInf) Downloader(c *cli.Context) *FileInf

Downloader : Download files.

func (*FileInf) GetDriveInformation

func (p *FileInf) GetDriveInformation() *FileInf

GetDriveInformation : Get Drive Information.

func (*FileInf) GetFileList

func (p *FileInf) GetFileList(c *cli.Context) *FileInf

GetFileList : Retrieving file list on Google Drive.

func (*FileInf) GetFileinf

func (p *FileInf) GetFileinf() *FileInf

GetFileinf : Retrieve file infomation using Drive API.

func (*FileInf) GetListLoop

func (p *FileInf) GetListLoop(q, fields string) fileListSt

GetListLoop : Loop for retrieving file list.

func (*FileInf) GetRevisionList

func (p *FileInf) GetRevisionList(c *cli.Context) *FileInf

GetRevisionList : Display revision IDs.

func (*FileInf) ManagePermissions

func (p *FileInf) ManagePermissions() *FileInf

ManagePermissions : Main method of Manage Permissions.

func (*FileInf) ProjectUpdateByAppsScriptApi

func (p *FileInf) ProjectUpdateByAppsScriptApi(pr *ProjectForAppsScriptApi) *AppsScriptApiInf

ProjectUpdateByAppsScriptApi : For uploading project using Apps Script API.

func (*FileInf) ResumableUpload

func (p *FileInf) ResumableUpload(metadata map[string]interface{}, fs *os.File, fstatus os.FileInfo) []byte

ResumableUpload : Main method of Resumable upload.

func (*FileInf) SearchFiles

func (p *FileInf) SearchFiles() *FileInf

SearchFiles : Searching files on Google Drive using query and regex.

func (*FileInf) Uploader

func (p *FileInf) Uploader(c *cli.Context) *FileInf

Uploader : Main method for uploading "$ ggsrun u -f t1.gs,t2.gs" or "$ ggsrun u -f "t1.gs, t2.gs"" Upload type is automatically selected by the file size.

type FilesForAppsScriptApi

type FilesForAppsScriptApi struct {
	Name           string          `json:"name"`
	Type           string          `json:"type"`
	Source         string          `json:"source"`
	CreateTime     time.Time       `json:"createTime,omitempty"`
	UpdateTime     time.Time       `json:"updateTime,omitempty"`
	Creator        *creator        `json:"creator,omitempty"`
	LastModifyUser *lastmodifyuser `json:"lastModifyUser,omitempty"`
}

FilesForAppsScriptApi : A file structure for Apps Script API

type ProjectForAppsScriptApi

type ProjectForAppsScriptApi struct {
	ScriptId string                  `json:"scriptId,omitempty"`
	Files    []FilesForAppsScriptApi `json:"files"`
}

ProjectForAppsScriptApi : Project structure for Apps Script API

type RequestParams

type RequestParams struct {
	Method        string
	APIURL        string
	Data          io.Reader
	Contenttype   string
	ContentLength string
	ContentRange  string
	Accesstoken   string
	Dtime         int64
}

RequestParams : Parameters for FetchAPI

func (*RequestParams) FetchAPI

func (r *RequestParams) FetchAPI() ([]byte, error)

FetchAPI : For fetching data to URL.

func (*RequestParams) FetchAPIRaw

func (r *RequestParams) FetchAPIRaw() (*http.Response, error)

FetchAPIRaw : For fetching data to URL. Raw data (http.Response) from API is returned.

func (*RequestParams) FetchAPIres

func (r *RequestParams) FetchAPIres() (*http.Response, error)

FetchAPIres : For fetching data to URL.

Jump to

Keyboard shortcuts

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