Versions in this module Expand all Collapse all v1 v1.0.4 May 2, 2022 v1.0.3 May 2, 2022 v1.0.2 May 2, 2022 Changes in this version + func ConvertZcnTokenToETH(token float64) (string, error) + func Decrypt(key, text string) (string, error) + func Encrypt(key, text string) (string, error) + func GEthToTokens(tokens int64) string + func GetAllocations() (string, error) + func GetBlobbers() (string, error) + func GetClientEncryptedPublicKey() (string, error) + func GetNetwork() (string, error) + func GetNumber(value string) int + func Init(chainConfigJson string) error + func RegisterToMiners(clientId, pubKey string, callback zcncore.WalletCallback) error + func SetLogFile(logFile string, verbose bool) + func SetLogLevel(logLevel int) + func Sign(hash string) (string, error) + func SuggestEthGasPrice() (string, error) + func TokensToEth(tokens int64) string + func VerifySignature(signature string, msg string) (bool, error) + type Allocation struct + DataShards int + Expiration int64 + ID string + Name string + ParityShards int + Size int64 + Stats string + func (a *Allocation) CancelDownload(remotepath string) error + func (a *Allocation) CancelRepair() error + func (a *Allocation) CancelUpload(localpath string) error + func (a *Allocation) CommitMetaTransaction(path, crudOperation, authTicket, lookupHash, fileMeta string, ...) error + func (a *Allocation) CopyObject(path string, destPath string) error + func (a *Allocation) CreateDir(dirName string) error + func (a *Allocation) DeleteFile(remotePath string) error + func (a *Allocation) DownloadFile(remotePath, localPath string, statusCb StatusCallbackMocked) error + func (a *Allocation) DownloadFileByBlock(remotePath, localPath string, startBlock, endBlock int64, numBlocks int, ...) error + func (a *Allocation) DownloadFromAuthTicket(localPath string, authTicket string, remoteLookupHash string, ...) error + func (a *Allocation) DownloadFromAuthTicketByBlocks(localPath string, authTicket string, startBlock, endBlock int64, numBlocks int, ...) error + func (a *Allocation) DownloadThumbnail(remotePath, localPath string, statusCb StatusCallbackMocked) error + func (a *Allocation) DownloadThumbnailFromAuthTicket(localPath string, authTicket string, remoteLookupHash string, ...) error + func (a *Allocation) EncryptAndUpdateFile(tmpPath, localPath, remotePath, fileAttrs string, ...) error + func (a *Allocation) EncryptAndUpdateFileWithThumbnail(tmpPath, localPath, remotePath, fileAttrs string, thumbnailpath string, ...) error + func (a *Allocation) EncryptAndUploadFile(tmpPath, localPath, remotePath, fileAttrs string, ...) error + func (a *Allocation) EncryptAndUploadFileWithThumbnail(tmpPath, localPath, remotePath, fileAttrs string, thumbnailpath string, ...) error + func (a *Allocation) GetAllocationStats() (string, error) + func (a *Allocation) GetAuthToken(path string, filename string, referenceType string, refereeClientID string, ...) (string, error) + func (a *Allocation) GetBlobberStats() (string, error) + func (a *Allocation) GetCurrentManifest() string + func (a *Allocation) GetDiff(lastSyncCachePath string, localRootPath string, localFileFilters string, ...) (string, error) + func (a *Allocation) GetFileMeta(path string) (string, error) + func (a *Allocation) GetFileMetaFromAuthTicket(authTicket string, lookupHash string) (string, error) + func (a *Allocation) GetFileStats(path string) (string, error) + func (a *Allocation) GetFirstSegment(localPath, remotePath, tmpPath string, delay, maxSegments int) (string, error) + func (a *Allocation) GetMaxStorageCost(size int64) (string, error) + func (a *Allocation) GetMaxStorageCostWithBlobbers(size int64, blobbersJson string) (string, error) + func (a *Allocation) GetMinStorageCost(size int64) (string, error) + func (a *Allocation) GetMinWriteRead() (string, error) + func (a *Allocation) GetShareAuthToken(path string, filename string, referenceType string, refereeClientID string) (string, error) + func (a *Allocation) ListDir(path string) (string, error) + func (a *Allocation) ListDirFromAuthTicket(authTicket string, lookupHash string) (string, error) + func (a *Allocation) MoveObject(path string, destPath string) error + func (a *Allocation) PlayStreaming(localPath, remotePath, authTicket, lookupHash, initSegment string, delay int, ...) error + func (a *Allocation) RenameObject(remotePath string, destName string) error + func (a *Allocation) RepairFile(localPath, remotePath string, statusCb StatusCallbackMocked) error + func (a *Allocation) SaveRemoteSnapshot(pathToSave string, remoteExcludePaths string) error + func (a *Allocation) StartRepair(localRootPath, pathToRepair string, statusCb StatusCallbackMocked) error + func (a *Allocation) StopStreaming() error + func (a *Allocation) UpdateFile(workDir, localPath, remotePath, fileAttrs string, ...) error + func (a *Allocation) UpdateFileWithThumbnail(workDir, localPath, remotePath, fileAttrs string, thumbnailpath string, ...) error + func (a *Allocation) UploadFile(workdir, localPath, remotePath, fileAttrs string, ...) error + func (a *Allocation) UploadFileWithThumbnail(tmpPath, localPath, remotePath, fileAttrs string, thumbnailpath string, ...) error + type AuthTicket struct + func InitAuthTicket(authTicket string) *AuthTicket + func (at *AuthTicket) GetFilename() (string, error) + func (at *AuthTicket) IsDir() (bool, error) + type ChainConfig struct + BlockWorker string + ChainID string + PreferredBlobbers []string + SignatureScheme string + type GetBalanceCallback interface + OnBalanceAvailable func(status int, value int64, info string) + type M3u8Downloader struct + type M3u8Writer interface + Sync func() error + Truncate func(size int64) error + type MediaItem struct + Name string + Path string + type MediaPlaylist struct + Seq int + Wait []string + Writer M3u8Writer + func NewMediaPlaylist(delay int, writer M3u8Writer) *MediaPlaylist + func (m *MediaPlaylist) Append(item string) + func (m *MediaPlaylist) Encode() []byte + func (m *MediaPlaylist) Play() + func (m *MediaPlaylist) String() string + type MinMaxCost struct + type StatusBarMocked struct + func (s *StatusBarMocked) CommitMetaCompleted(request, response string, txn *transaction.Transaction, err error) + func (s *StatusBarMocked) Completed(allocationId, filePath string, filename string, mimetype string, size int, ...) + func (s *StatusBarMocked) Error(allocationID string, filePath string, op int, err error) + func (s *StatusBarMocked) InProgress(allocationId, filePath string, op int, completedBytes int, data []byte) + func (s *StatusBarMocked) RepairCompleted(filesRepaired int) + func (s *StatusBarMocked) Started(allocationId, filePath string, op int, totalBytes int) + type StatusCallbackMocked interface + CommitMetaCompleted func(request, response string, err error) + Completed func(allocationId, filePath string, filename string, mimetype string, size int, ...) + Error func(allocationID string, filePath string, op int, err error) + InProgress func(allocationId, filePath string, op int, completedBytes int, data []byte) + RepairCompleted func(filesRepaired int) + Started func(allocationId, filePath string, op int, totalBytes int) + type StatusCallbackWrapped struct + Callback StatusCallbackMocked + func (c *StatusCallbackWrapped) CommitMetaCompleted(request, response string, txn *transaction.Transaction, err error) + func (c *StatusCallbackWrapped) Completed(allocationId, filePath string, filename string, mimetype string, size int, ...) + func (c *StatusCallbackWrapped) Error(allocationID string, filePath string, op int, err error) + func (c *StatusCallbackWrapped) InProgress(allocationId, filePath string, op int, completedBytes int, data []byte) + func (c *StatusCallbackWrapped) RepairCompleted(filesRepaired int) + func (c *StatusCallbackWrapped) Started(allocationId, filePath string, op int, totalBytes int) + type StorageSDK struct + func InitStorageSDK(clientjson string, configjson string) (*StorageSDK, error) + func (s *StorageSDK) CancelAllocation(allocationID string) (string, error) + func (s *StorageSDK) CreateAllocation(name string, datashards, parityshards int, size, expiration, lock int64) (*Allocation, error) + func (s *StorageSDK) CreateAllocationWithBlobbers(name string, datashards, parityshards int, size, expiration, lock int64, ...) (*Allocation, error) + func (s *StorageSDK) CreateReadPool() error + func (s *StorageSDK) FinalizeAllocation(allocationID string) (string, error) + func (s *StorageSDK) GetAllocation(allocationID string) (*Allocation, error) + func (s *StorageSDK) GetAllocationFromAuthTicket(authTicket string) (*Allocation, error) + func (s *StorageSDK) GetAllocationStats(allocationID string) (string, error) + func (s *StorageSDK) GetAllocations() (string, error) + func (s *StorageSDK) GetBlobbersList() (string, error) + func (s *StorageSDK) GetReadPoolInfo(allocID string) (string, error) + func (s *StorageSDK) GetVersion() string + func (s *StorageSDK) GetWritePoolInfo(allocID string) (string, error) + func (s *StorageSDK) ReadPoolLock(durInSeconds int64, tokens, fee float64, allocID, blobberID string) error + func (s *StorageSDK) ReadPoolUnlock(poolID string, fee float64) error + func (s *StorageSDK) UpdateAllocation(name string, size, expiry int64, allocationID string, lock int64) (hash string, err error) + func (s *StorageSDK) WritePoolLock(durInSeconds int64, tokens, fee float64, allocID, blobberID string) error + func (s *StorageSDK) WritePoolUnlock(poolID string, fee float64) error + type StreamingImpl interface + GetCurrentManifest func() string + GetFirstSegment func(localPath, remotePath, tmpPath string, delay, maxSegments int) (string, error) + PlayStreaming func(localPath, remotePath, authTicket, lookupHash, initSegment string, delay int, ...) error + Stop func() error + func CreateStreamingService(allocation *Allocation) StreamingImpl + type StreamingService struct + func (s *StreamingService) GetCurrentManifest() string + func (s *StreamingService) GetFirstSegment(localPath, remotePath, tmpPath string, delay, maxSegments int) (string, error) + func (s *StreamingService) PlayStreaming(localPath, remotePath, authTicket, lookupHash, initSegment string, delay int, ...) error + func (s *StreamingService) Stop() error + type WalletCallback interface + OnWalletCreateComplete func(status int, wallet string, err string) v1.0.2-RC1 Oct 16, 2020