Documentation ¶
Index ¶
- type AmazonS3Client
- type AmazonS3StorageBackend
- func (*AmazonS3StorageBackend) AvailableSpace() (uint64, error)
- func (*AmazonS3StorageBackend) Close() error
- func (*AmazonS3StorageBackend) CreatePath(path string) error
- func (backend *AmazonS3StorageBackend) DeleteFile(path string) error
- func (*AmazonS3StorageBackend) Description() string
- func (backend *AmazonS3StorageBackend) Location() string
- func (*AmazonS3StorageBackend) NewBackend(url url.URL) (knoxite.Backend, error)
- func (*AmazonS3StorageBackend) Protocols() []string
- func (backend *AmazonS3StorageBackend) ReadFile(path string) ([]byte, error)
- func (backend *AmazonS3StorageBackend) Stat(path string) (uint64, error)
- func (backend *AmazonS3StorageBackend) WriteFile(path string, data []byte) (uint64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AmazonS3Client ¶
type AmazonS3Client interface { GetObject(input *s3.GetObjectInput) (*s3.GetObjectOutput, error) HeadObject(input *s3.HeadObjectInput) (*s3.HeadObjectOutput, error) PutObject(input *s3.PutObjectInput) (*s3.PutObjectOutput, error) DeleteObject(input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error) }
AmazonS3Client is an abstraction over the functions used from aws-golang-sdk's S3 client. Using this instead of the client directly makes it easier to mock.
type AmazonS3StorageBackend ¶
type AmazonS3StorageBackend struct { knoxite.StorageFilesystem // contains filtered or unexported fields }
AmazonS3StorageBackend is the storage backend that adapts knoxite's backend interface to Amazon S3.
func (*AmazonS3StorageBackend) AvailableSpace ¶
func (*AmazonS3StorageBackend) AvailableSpace() (uint64, error)
AvailableSpace returns the free space on this backend.
func (*AmazonS3StorageBackend) Close ¶
func (*AmazonS3StorageBackend) Close() error
Close closes the StorageFileSystem.
func (*AmazonS3StorageBackend) CreatePath ¶
func (*AmazonS3StorageBackend) CreatePath(path string) error
CreatePath creates a folder in a filesystem-like storage backend.
func (*AmazonS3StorageBackend) DeleteFile ¶
func (backend *AmazonS3StorageBackend) DeleteFile(path string) error
DeleteFile deletes a file from the storage backend.
func (*AmazonS3StorageBackend) Description ¶
func (*AmazonS3StorageBackend) Description() string
Description returns a human-readable description for the Storage backend.
func (*AmazonS3StorageBackend) Location ¶
func (backend *AmazonS3StorageBackend) Location() string
Location returns the backend's URL as a string.
func (*AmazonS3StorageBackend) NewBackend ¶
NewBackend initializes an Amazon S3 Storage Backend.
func (*AmazonS3StorageBackend) Protocols ¶
func (*AmazonS3StorageBackend) Protocols() []string
Protocols returns a list of supported Protocol Handlers.
func (*AmazonS3StorageBackend) ReadFile ¶
func (backend *AmazonS3StorageBackend) ReadFile(path string) ([]byte, error)
ReadFile reads a file from the backend.