Documentation ¶
Index ¶
- func ExtractFileExtension(filePath string) (string, error)
- func ExtractFileName(filePath string) (string, error)
- func SaveFileLocally(filePath string, data []byte) error
- type StorjClient
- type StorjService
- func (s *StorjService) AddFile(bucketName string, pathStorj string, pathFile string) error
- func (s *StorjService) AddFileBytes(bucketName string, pathStorj string, content []byte) error
- func (s *StorjService) DeleteFile(bucketName string, pathStorj string) error
- func (s *StorjService) GetFile(bucketName string, pathStorj string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFileExtension ¶
ExtractFileExtension extracts the file extension from a file path
func ExtractFileName ¶
ExtractFileName extracts the name of the file from a file path.
func SaveFileLocally ¶
SaveFileLocally writes the data to the specified local path
Types ¶
type StorjClient ¶
type StorjClient interface { UploadObject(ctx context.Context, bucket, key string, options *uplink.UploadOptions) (*uplink.Upload, error) DownloadObject(ctx context.Context, bucket, key string, options *uplink.DownloadOptions) (*uplink.Download, error) DeleteObject(ctx context.Context, bucket, key string) (*uplink.Object, error) }
StorjClient encapsulates the methods from uplink.Project that are used.
type StorjService ¶
type StorjService struct {
Client StorjClient
}
func NewStorjService ¶
func NewStorjService(secret string) (*StorjService, error)
func (*StorjService) AddFile ¶
func (s *StorjService) AddFile(bucketName string, pathStorj string, pathFile string) error
AddFile uploads a file to the specified path in the Storj bucket
func (*StorjService) AddFileBytes ¶
func (s *StorjService) AddFileBytes(bucketName string, pathStorj string, content []byte) error
AddFileBytes uploads a file,writing on file bytes, to the specified path in the Storj bucket
func (*StorjService) DeleteFile ¶
func (s *StorjService) DeleteFile(bucketName string, pathStorj string) error
DeleteFile deletes a file from the specified path in the Storj bucket
Click to show internal directories.
Click to hide internal directories.