drive

package
v0.0.0-...-aafedb1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: GPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MIN_FID_POOL_SIZE = 10
	OK_FID_POOL_SIZE  = 20
)
View Source
const (
	DRIVE_FILE_FIELDS = "id,name,mimeType,trashed,permissions,parents,webContentLink,viewedByMeTime,createdTime,modifiedTime,ownedByMe,size"
)

Variables

View Source
var (
	//Holds the mandatory fields to get from drive
	DRIVE_FIELDS = []googleapi.Field{"nextPageToken", googleapi.Field(fmt.Sprintf("files(%s)", DRIVE_FILE_FIELDS))}
)

Functions

func Init

func Init(ctx context.Context, lg Logger, cnfp *Config, client *http.Client, wtg *sync.WaitGroup, reqchan chan *Request, evtch chan<- *Event) error

Types

type FileIDPool

type FileIDPool struct {
	// contains filtered or unexported fields
}

This struct holds the FileID pool

func NewFileIDPool

func NewFileIDPool() (pool *FileIDPool, err error)

Generate a new FileIDPool and populate it with OK_FID_POOL_SIZE

func (*FileIDPool) GetFileID

func (fp *FileIDPool) GetFileID() (fid string, err error)

Get a FileID. The pool should have at least an ID available If no ID is available, will hold until Drive generates some IDs and we fill the pool

Jump to

Keyboard shortcuts

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