zcn

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpUpload   int = 0
	OpDownload int = 1
	OpRepair   int = 2
)
View Source
const CHUNK_SIZE = (64 * 1024)

Variables

Functions

func CloseLog

func CloseLog()

Close log file

func GetVersion

func GetVersion() string

Returns the SDO version string

func SetLogFile

func SetLogFile(logFile string, verbose bool)

logFile - Log file verbose - true - console output; false - no console output

func SetLogLevel

func SetLogLevel(lvl int)

lvl - 0 disabled; higher number (upto 4) more verbosity

Types

type Allocation

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

func CreateInstance

func CreateInstance(allocationId string) (*Allocation, error)

func (*Allocation) AddDir

func (obj *Allocation) AddDir(path string) error

func (*Allocation) Commit

func (obj *Allocation) Commit() error

func (*Allocation) DeleteFile

func (obj *Allocation) DeleteFile(remotePath string) error

func (*Allocation) DownloadCancel

func (obj *Allocation) DownloadCancel()

Cancel ongoing download

func (*Allocation) DownloadFile

func (obj *Allocation) DownloadFile(remotePath, localPath string, statusCb StatusCallback) error
func (obj *Allocation) DownloadFileFromShareLink(localPath string, authTokenB64 string, statusCb StatusCallback) error

func (*Allocation) GetBlobbers

func (obj *Allocation) GetBlobbers() string

func (*Allocation) GetDirTree

func (obj *Allocation) GetDirTree() string

func (*Allocation) GetFileStats

func (obj *Allocation) GetFileStats(remotePath string) string

func (*Allocation) GetShareAuthToken

func (obj *Allocation) GetShareAuthToken(remotePath string, clientID string) string

func (*Allocation) ListDir

func (obj *Allocation) ListDir(path string) string

func (*Allocation) RepairFile

func (obj *Allocation) RepairFile(localPath, remotePath string, statusCb StatusCallback) error

func (*Allocation) SetConfig

func (obj *Allocation) SetConfig(clientJson, dirTreeJson, blobbersJson string, iDataShards, iParityShard int) error

func (*Allocation) UpdateFile

func (obj *Allocation) UpdateFile(localPath, remotePath string, statusCb StatusCallback) error

func (*Allocation) UploadFile

func (obj *Allocation) UploadFile(localPath, remotePath string, statusCb StatusCallback) error

func (*Allocation) UploadOrRepairFile

func (obj *Allocation) UploadOrRepairFile(localPath, remotePath string, statusCb StatusCallback) error

type StatusCallback

type StatusCallback interface {
	Started(allocationId, filePath string, op int, totalBytes int)
	InProgress(allocationId, filePath string, op int, completedBytes int)
	Completed(allocationId, filePath string, filename string, mimetype string, size int, op int)
}

Jump to

Keyboard shortcuts

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