intf

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptoService

type CryptoService interface {
	IsEnabled() bool
	GetPassword() string
	SetPassword(password string)
	//EncryptFile(source string, target string)
	//DecryptFile(source string, target string)
	//EncryptFileName(fileName string) string
	//DecryptFileName(fileName string) (string, error)
	//JustDecryptFileName(fileName string) string
	//DecodeViaPipe(reader io.Reader, writer io.Writer) error
	//EncodeViaPipe(reader io.Reader, writer io.Writer) error
	DecodeViaPipe(reader io.Reader, writer io.Writer) error
	DecodeAndDownloadFromReader(fileName string, reader io.Reader) error
	EncodeAndUploadReader(fileName string, updateWriter func(writer io.Writer) io.Writer, callback func(reader io.Reader) error) error
	Close()

	EncryptFileNameWithMd5(fileName string, md5 string) string
	DecryptFileNameWithMd5(file *drive.File) (string, string, error)

	GetEncoder() string
	GetDecoder() string
}

type DatabaseBackend

type DatabaseBackend interface {
	Initialize(databaseFile string, debug bool, callback func(expose interface{})) error
	ConnectionEstablish(callback func(connection DatabaseBackendConnection) error) error
}

type DatabaseBackendConnection

type DatabaseBackendConnection interface {
	CreateDatabase() error
	FindFirstById(id string, data *models.SyncFileInfo) error
	Persist(data *models.SyncFileInfo) error
	SaveOrUpdate(data *models.SyncFileInfo) error
	Delete(data *models.SyncFileInfo) error

	ReadConfig(id string, data *models.GoogleDriveConfig) error
	ReadConfigByFolderId(folderId string, data *models.GoogleDriveConfig) error
	SaveConfig(data *models.GoogleDriveConfig) error
	FindAllConfig() ([]models.GoogleDriveConfig, error)

	Find(out interface{}, where ...interface{}) error
}

type DriveAPI

type DriveAPI interface {
	ReadTeamDrives(callback func(teamDrive *drive.TeamDrive) bool) error
	ChangeFolder(folderNameOrId string)
	FileInfo(fileNameOrId string, fileNameDecoder func(*drive.File) string) (string, *drive.File, error)
	List()
	ListFolder(folderId string)
	ReadFolderDetail(folderId string, allDrive bool, callback func(file *drive.File) bool) error
	ListWithDecoder(fileNameDecoder func(*drive.File) string)
	Upload(localFile string) error
	//Download(fileNameOrId string, localFile string) (string, error)
	RetrieveFile(fileNameOrId string, fileRetriever func(*drive.File, io.Reader) error) error
	CreateFolder(folderName string)
	CurrentFolder() string
	Delete(fileNameOrId string)
	DropFile(fileNameOrId string)
	Pushd()
	Popd()
	Dirs()
	Version()
	Duplicate(fileNameOrId string, fileName string)
	Rename(fileNameOrId string, fileName string)
	FindOrCreateTrashFolder(fileId string) (string, error)
	EncryptedUpload(cryptoService CryptoService, fileFullPath string,
		folderId string, fileName string, md5sum string) error
	ShareInfo(fileNameOrId string) error
	ShareFileWith(fileId string, email string, role models.Role) error
	UnshareFileWith(fileId string, email string) error
	RemovePermission(fileId string, permissionId string) error
	PermissionInfo(driveId string, callback func(permission *drive.Permission)) error
	SetDomainAdminAccess(useDomainAdminAccess bool)
	GetDomainAdminAccess() bool
	SetImpersonate(impersonate string)
	GetImpersonate() string
	GetCredentialEmail() (string, error)

	DownloadFile(fileNameOrId string, dir string, localFile string) error
	NativeDownloadFile(driveSvc *drive.Service, fileNameOrId string, dir string, localFile string) error
}

type SqlDatabaseInterface

type SqlDatabaseInterface interface {
	Connection(callback func(xdb *dbconn.DB) error) error
}

Jump to

Keyboard shortcuts

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