Documentation ¶
Overview ¶
Package storageclient expose client side API usage for the secure storage service (S3 frontend) this package implements the filemanager DataSaver interface.
Index ¶
- type Progress
- type RequestStatus
- type Status
- type StorageClient
- func (s *StorageClient) Close()
- func (s *StorageClient) DeleteChunks(filename string, files []string, operationID *fm.ContextID) error
- func (s *StorageClient) ProgressStatus(requestID fm.ContextID) (fm.ProgressStatus, error)
- func (s *StorageClient) RetrieveChunks(filename string, files []string, operationID *fm.ContextID) ([][]byte, error)
- func (s *StorageClient) SaveChunks(filename string, chunks [][]byte, hashedValue []byte, expire time.Duration, ...) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Progress ¶
Progress is used to maintain the status of various files update, it report the initial number of files and as soon as upload successfully terminates, the number of uploaded parts.
func (*Progress) Done ¶
Done part of the ProgressStatus interface returns the number of already processed elements.
func (*Progress) TotalUnits ¶
TotalUnits part of the ProgressStatus interface returns the total number of units to be processed.
type RequestStatus ¶
RequestStatus gloabally request related status infos is used to maintain, protected in a concurrent environment, all resources status and a global progress data (that can be used to report the progress status to the UI).
func NewRequestStatus ¶
func NewRequestStatus(reqID string, count int) *RequestStatus
NewRequestStatus creates a new request status, having as pre-requisite that all the ids are different (should always be the case in 3nigm4 scenario).
func (*RequestStatus) Completed ¶
func (rs *RequestStatus) Completed() bool
Completed returns true if all resources composing a request have been processed or not, this do not means that no error occurred but only that API games are over.
type Status ¶
Status the status of the required resource operation is used to asyncronously return the data passed back by the job GET method from APIs.
type StorageClient ¶
type StorageClient struct { ErrorChan chan error // contains filtered or unexported fields }
StorageClient is the base structure used to implement the interface methods.
func NewStorageClient ¶
func NewStorageClient( address string, port int, token string, workersize, queuesize int) (*StorageClient, error, <-chan error)
NewStorageClient creates a new StorageClient structure and setup all required properties. It'll start the working queue that'll be used to enqueue http API facing jobs. The returned read only chan must be used to check for client errors.
func (*StorageClient) DeleteChunks ¶
func (s *StorageClient) DeleteChunks(filename string, files []string, operationID *fm.ContextID) error
DeleteChunks delete, requiring the API frontend, all resources composing a file (several resources compose a single file).
func (*StorageClient) ProgressStatus ¶
func (s *StorageClient) ProgressStatus(requestID fm.ContextID) (fm.ProgressStatus, error)
ProgressStatus conforms to the DataSaver interface and returns progress metrics about the in progress operation.
func (*StorageClient) RetrieveChunks ¶
func (s *StorageClient) RetrieveChunks(filename string, files []string, operationID *fm.ContextID) ([][]byte, error)
RetrieveChunks starts the async retrieve of previously uploaded chunks starting from the returned files names.
func (*StorageClient) SaveChunks ¶
func (s *StorageClient) SaveChunks(filename string, chunks [][]byte, hashedValue []byte, expire time.Duration, permission *fm.Permission, operationID *fm.ContextID) ([]string, error)
SaveChunks start the async upload of all argument passed chunks generating a single name for each one.