Documentation ¶
Index ¶
- Constants
- func AddBlockDownloadReq(req *BlockDownloadRequest)
- func AddCommitRequest(req *CommitRequest)
- func CreateAllocation(datashards int, parityshards int, size int64, expiry int64) (string, error)
- func CreateAllocationForOwner(owner string, ownerpublickey string, datashards int, parityshards int, ...) (string, error)
- func GetVersion() string
- func InitBlockDownloader(blobbers []*blockchain.StorageNode)
- func InitCommitWorker(blobbers []*blockchain.StorageNode)
- func InitStorageSDK(clientJson string, miners []string, sharders []string, chainID string, ...) error
- func SetLogFile(logFile string, verbose bool)
- type Allocation
- func (a *Allocation) CancelDownload(remotepath string) error
- func (a *Allocation) CopyObject(path string, destPath string) error
- func (a *Allocation) DeleteFile(path string) error
- func (a *Allocation) DownloadFile(localPath string, remotePath string, status StatusCallback) error
- func (a *Allocation) DownloadFromAuthTicket(localPath string, authTicket string, remoteLookupHash string, ...) error
- func (a *Allocation) DownloadThumbnail(localPath string, remotePath string, status StatusCallback) error
- func (a *Allocation) DownloadThumbnailFromAuthTicket(localPath string, authTicket string, remoteLookupHash string, ...) error
- func (a *Allocation) EncryptAndUpdateFile(localpath string, remotepath string, status StatusCallback) error
- func (a *Allocation) EncryptAndUpdateFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, ...) error
- func (a *Allocation) EncryptAndUploadFile(localpath string, remotepath string, status StatusCallback) error
- func (a *Allocation) EncryptAndUploadFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, ...) error
- func (a *Allocation) GetAllocationDiff(lastSyncCachePath string, localRootPath string, localFileFilters []string, ...) ([]FileDiff, error)
- func (a *Allocation) GetAuthTicketForShare(path string, filename string, referenceType string, refereeClientID string) (string, error)
- func (a *Allocation) GetFileMeta(path string) (*ConsolidatedFileMeta, error)
- func (a *Allocation) GetFileMetaFromAuthTicket(authTicket string, lookupHash string) (*ConsolidatedFileMeta, error)
- func (a *Allocation) GetFileStats(path string) (map[string]*FileStats, error)
- func (a *Allocation) GetStats() *AllocationStats
- func (a *Allocation) InitAllocation()
- func (a *Allocation) ListDir(path string) (*ListResult, error)
- func (a *Allocation) ListDirFromAuthTicket(authTicket string, lookupHash string) (*ListResult, error)
- func (a *Allocation) RenameObject(path string, destName string) error
- func (a *Allocation) SaveRemoteSnapshot(pathToSave string, remoteExcludePath []string) error
- func (a *Allocation) UpdateFile(localpath string, remotepath string, status StatusCallback) error
- func (a *Allocation) UpdateFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, ...) error
- func (a *Allocation) UploadFile(localpath string, remotepath string, status StatusCallback) error
- func (a *Allocation) UploadFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, ...) error
- type AllocationStats
- type AuthTicket
- type BlockDownloadRequest
- type CommitRequest
- type CommitResult
- type Consensus
- type ConsolidatedFileMeta
- type CopyRequest
- type DeleteRequest
- type DownloadRequest
- type FileDiff
- type FileStats
- type ListRequest
- type ListResult
- type ReferencePathResult
- type RenameRequest
- type ShareRequest
- type StatusCallback
- type UploadFileMeta
- type UploadRequest
Constants ¶
View Source
const ( DOWNLOAD_CONTENT_FULL = "full" DOWNLOAD_CONTENT_THUMB = "thumbnail" )
View Source
const ( OpUpload int = 0 OpDownload int = 1 OpRepair int = 2 )
View Source
const ( Upload = "Upload" Download = "Download" Update = "Update" Delete = "Delete" Conflict = "Conflict" LocalDelete = "LocalDelete" )
For sync app
View Source
const STORAGE_SCADDRESS = "6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d7"
Variables ¶
This section is empty.
Functions ¶
func AddBlockDownloadReq ¶
func AddBlockDownloadReq(req *BlockDownloadRequest)
func AddCommitRequest ¶
func AddCommitRequest(req *CommitRequest)
func CreateAllocation ¶
func InitBlockDownloader ¶
func InitBlockDownloader(blobbers []*blockchain.StorageNode)
func InitCommitWorker ¶
func InitCommitWorker(blobbers []*blockchain.StorageNode)
func InitStorageSDK ¶
func SetLogFile ¶
logFile - Log file verbose - true - console output; false - no console output
Types ¶
type Allocation ¶
type Allocation struct { ID string `json:"id"` DataShards int `json:"data_shards"` ParityShards int `json:"parity_shards"` Size int64 `json:"size"` Expiration int64 `json:"expiration_date"` Owner string `json:"owner_id"` OwnerPublicKey string `json:"owner_public_key"` Payer string `json:"payer_id"` Blobbers []*blockchain.StorageNode `json:"blobbers"` Stats *AllocationStats `json:"stats"` // contains filtered or unexported fields }
func GetAllocation ¶
func GetAllocation(allocationID string) (*Allocation, error)
func GetAllocationFromAuthTicket ¶
func GetAllocationFromAuthTicket(authTicket string) (*Allocation, error)
func GetAllocations ¶
func GetAllocations() ([]*Allocation, error)
func GetAllocationsForClient ¶
func GetAllocationsForClient(clientID string) ([]*Allocation, error)
func (*Allocation) CancelDownload ¶
func (a *Allocation) CancelDownload(remotepath string) error
func (*Allocation) CopyObject ¶
func (a *Allocation) CopyObject(path string, destPath string) error
func (*Allocation) DeleteFile ¶
func (a *Allocation) DeleteFile(path string) error
func (*Allocation) DownloadFile ¶
func (a *Allocation) DownloadFile(localPath string, remotePath string, status StatusCallback) error
func (*Allocation) DownloadFromAuthTicket ¶
func (a *Allocation) DownloadFromAuthTicket(localPath string, authTicket string, remoteLookupHash string, remoteFilename string, status StatusCallback) error
func (*Allocation) DownloadThumbnail ¶
func (a *Allocation) DownloadThumbnail(localPath string, remotePath string, status StatusCallback) error
func (*Allocation) DownloadThumbnailFromAuthTicket ¶
func (a *Allocation) DownloadThumbnailFromAuthTicket(localPath string, authTicket string, remoteLookupHash string, remoteFilename string, status StatusCallback) error
func (*Allocation) EncryptAndUpdateFile ¶
func (a *Allocation) EncryptAndUpdateFile(localpath string, remotepath string, status StatusCallback) error
func (*Allocation) EncryptAndUpdateFileWithThumbnail ¶
func (a *Allocation) EncryptAndUpdateFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, status StatusCallback) error
func (*Allocation) EncryptAndUploadFile ¶
func (a *Allocation) EncryptAndUploadFile(localpath string, remotepath string, status StatusCallback) error
func (*Allocation) EncryptAndUploadFileWithThumbnail ¶
func (a *Allocation) EncryptAndUploadFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, status StatusCallback) error
func (*Allocation) GetAllocationDiff ¶
func (*Allocation) GetAuthTicketForShare ¶
func (*Allocation) GetFileMeta ¶
func (a *Allocation) GetFileMeta(path string) (*ConsolidatedFileMeta, error)
func (*Allocation) GetFileMetaFromAuthTicket ¶
func (a *Allocation) GetFileMetaFromAuthTicket(authTicket string, lookupHash string) (*ConsolidatedFileMeta, error)
func (*Allocation) GetFileStats ¶
func (a *Allocation) GetFileStats(path string) (map[string]*FileStats, error)
func (*Allocation) GetStats ¶
func (a *Allocation) GetStats() *AllocationStats
func (*Allocation) InitAllocation ¶
func (a *Allocation) InitAllocation()
func (*Allocation) ListDir ¶
func (a *Allocation) ListDir(path string) (*ListResult, error)
func (*Allocation) ListDirFromAuthTicket ¶
func (a *Allocation) ListDirFromAuthTicket(authTicket string, lookupHash string) (*ListResult, error)
func (*Allocation) RenameObject ¶
func (a *Allocation) RenameObject(path string, destName string) error
func (*Allocation) SaveRemoteSnapshot ¶
func (a *Allocation) SaveRemoteSnapshot(pathToSave string, remoteExcludePath []string) error
SaveRemoteSnapShot - Saves the remote current information to the given file This file can be passed to GetAllocationDiff to exactly find the previous sync state to current.
func (*Allocation) UpdateFile ¶
func (a *Allocation) UpdateFile(localpath string, remotepath string, status StatusCallback) error
func (*Allocation) UpdateFileWithThumbnail ¶
func (a *Allocation) UpdateFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, status StatusCallback) error
func (*Allocation) UploadFile ¶
func (a *Allocation) UploadFile(localpath string, remotepath string, status StatusCallback) error
func (*Allocation) UploadFileWithThumbnail ¶
func (a *Allocation) UploadFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, status StatusCallback) error
type AllocationStats ¶
type AllocationStats struct { UsedSize int64 `json:"used_size"` NumWrites int64 `json:"num_of_writes"` NumReads int64 `json:"num_of_reads"` TotalChallenges int64 `json:"total_challenges"` OpenChallenges int64 `json:"num_open_challenges"` SuccessChallenges int64 `json:"num_success_challenges"` FailedChallenges int64 `json:"num_failed_challenges"` LastestClosedChallengeTxn string `json:"latest_closed_challenge"` }
type AuthTicket ¶
type AuthTicket struct {
// contains filtered or unexported fields
}
func InitAuthTicket ¶
func InitAuthTicket(authTicket string) *AuthTicket
func (*AuthTicket) GetFileName ¶
func (at *AuthTicket) GetFileName() (string, error)
func (*AuthTicket) GetLookupHash ¶
func (at *AuthTicket) GetLookupHash() (string, error)
func (*AuthTicket) IsDir ¶
func (at *AuthTicket) IsDir() (bool, error)
type BlockDownloadRequest ¶
type BlockDownloadRequest struct {
// contains filtered or unexported fields
}
type CommitRequest ¶
type CommitRequest struct {
// contains filtered or unexported fields
}
type CommitResult ¶
type CommitResult struct { Success bool `json:"success"` ErrorMessage string `json:"error_msg,omitempty"` }
func ErrorCommitResult ¶
func ErrorCommitResult(errMsg string) *CommitResult
func SuccessCommitResult ¶
func SuccessCommitResult() *CommitResult
type ConsolidatedFileMeta ¶
type CopyRequest ¶
type CopyRequest struct { Consensus // contains filtered or unexported fields }
func (*CopyRequest) ProcessCopy ¶
func (req *CopyRequest) ProcessCopy() error
type DeleteRequest ¶
type DeleteRequest struct { Consensus // contains filtered or unexported fields }
func (*DeleteRequest) ProcessDelete ¶
func (req *DeleteRequest) ProcessDelete() error
type DownloadRequest ¶
type DownloadRequest struct { Consensus // contains filtered or unexported fields }
type FileStats ¶
type FileStats struct { Name string `json:"name"` Size int64 `json:"size"` PathHash string `json:"path_hash"` Path string `json:"path"` NumBlocks int64 `json:"num_of_blocks"` NumUpdates int64 `json:"num_of_updates"` NumBlockDownloads int64 `json:"num_of_block_downloads"` SuccessChallenges int64 `json:"num_of_challenges"` FailedChallenges int64 `json:"num_of_failed_challenges"` LastChallengeResponseTxn string `json:"last_challenge_txn"` WriteMarkerRedeemTxn string `json:"write_marker_txn"` BlobberID string `json:"blobber_id"` BlobberURL string `json:"blobber_url"` BlockchainAware bool `json:"blockchain_aware"` }
type ListRequest ¶
type ListRequest struct { Consensus // contains filtered or unexported fields }
func (*ListRequest) GetListFromBlobbers ¶
func (req *ListRequest) GetListFromBlobbers() *ListResult
type ListResult ¶
type ListResult struct { Name string `json:"name"` Path string `json:"path,omitempty"` Type string `json:"type"` Size int64 `json:"size"` Hash string `json:"hash,omitempty"` MimeType string `json:"mimetype,omitempty"` NumBlocks int64 `json:"num_blocks"` LookupHash string `json:"lookup_hash"` Children []*ListResult `json:"list"` Consensus `json:"-"` }
type ReferencePathResult ¶
type ReferencePathResult struct { *fileref.ReferencePath LatestWM *marker.WriteMarker `json:"latest_write_marker"` }
type RenameRequest ¶
type RenameRequest struct { Consensus // contains filtered or unexported fields }
func (*RenameRequest) ProcessRename ¶
func (req *RenameRequest) ProcessRename() error
type ShareRequest ¶
type ShareRequest struct {
// contains filtered or unexported fields
}
func (*ShareRequest) GetAuthTicket ¶
func (req *ShareRequest) GetAuthTicket(clientID string) (string, error)
type StatusCallback ¶
type StatusCallback interface { Started(allocationId, filePath string, op int, totalBytes int) InProgress(allocationId, filePath string, op int, completedBytes int) Error(allocationID string, filePath string, op int, err error) Completed(allocationId, filePath string, filename string, mimetype string, size int, op int) }
type UploadFileMeta ¶
type UploadRequest ¶
type UploadRequest struct { Consensus // contains filtered or unexported fields }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.