Documentation
¶
Index ¶
- type AWSCloudStorage
- func (ts *AWSCloudStorage) Attributes(ctx context.Context, key string) (*Attributes, error)
- func (ts *AWSCloudStorage) Close()
- func (ts *AWSCloudStorage) CreateBucket(ctx context.Context, bucketPrefix string, expirationTimeDays int64) error
- func (ts *AWSCloudStorage) Delete(ctx context.Context, key string) error
- func (ts *AWSCloudStorage) Get(ctx context.Context, key string) ([]byte, error)
- func (ts *AWSCloudStorage) GetReader(ctx context.Context, key string) (io.ReadCloser, error)
- func (ts *AWSCloudStorage) GetSignedURL(ctx context.Context, key string, expiry time.Duration) (string, error)
- func (ts *AWSCloudStorage) GetWriter(ctx context.Context, key string) (io.WriteCloser, error)
- func (ts *AWSCloudStorage) List(ctx context.Context, prefix string) *ListIterator
- func (ts *AWSCloudStorage) Write(ctx context.Context, key string, body []byte, contentType *string) error
- type AWSTestCloudStorage
- func (ts *AWSTestCloudStorage) Attributes(ctx context.Context, key string) (*Attributes, error)
- func (ts *AWSTestCloudStorage) Close()
- func (ts *AWSTestCloudStorage) CreateBucket(ctx context.Context, bucketPrefix string, expirationTimeDays int64) error
- func (ts *AWSTestCloudStorage) Delete(ctx context.Context, key string) error
- func (ts *AWSTestCloudStorage) Get(ctx context.Context, key string) ([]byte, error)
- func (ts *AWSTestCloudStorage) GetReader(ctx context.Context, key string) (io.ReadCloser, error)
- func (ts *AWSTestCloudStorage) GetSignedURL(ctx context.Context, key string, expiry time.Duration) (string, error)
- func (ts *AWSTestCloudStorage) GetWriter(ctx context.Context, key string) (io.WriteCloser, error)
- func (ts *AWSTestCloudStorage) List(ctx context.Context, prefix string) *ListIterator
- func (ts *AWSTestCloudStorage) Write(ctx context.Context, key string, body []byte, contentType *string) error
- type Attributes
- type CloudStorage
- type GCPCloudStorage
- func (ts *GCPCloudStorage) Attributes(ctx context.Context, key string) (*Attributes, error)
- func (ts *GCPCloudStorage) Close()
- func (ts *GCPCloudStorage) CreateBucket(ctx context.Context, bucketPrefix string, expirationTimeDays int64) error
- func (ts *GCPCloudStorage) Delete(ctx context.Context, key string) error
- func (ts *GCPCloudStorage) Get(ctx context.Context, key string) ([]byte, error)
- func (ts *GCPCloudStorage) GetReader(ctx context.Context, key string) (io.ReadCloser, error)
- func (ts *GCPCloudStorage) GetSignedURL(ctx context.Context, key string, expiry time.Duration) (string, error)
- func (ts *GCPCloudStorage) GetWriter(ctx context.Context, key string) (io.WriteCloser, error)
- func (ts *GCPCloudStorage) List(ctx context.Context, prefix string) *ListIterator
- func (ts *GCPCloudStorage) Write(ctx context.Context, key string, body []byte, contentType *string) error
- type GCPTestCloudStorage
- func (ts *GCPTestCloudStorage) Attributes(ctx context.Context, key string) (*Attributes, error)
- func (ts *GCPTestCloudStorage) Close()
- func (ts *GCPTestCloudStorage) CreateBucket(ctx context.Context, bucketPrefix string, expirationTimeDays int64) error
- func (ts *GCPTestCloudStorage) Delete(ctx context.Context, key string) error
- func (ts *GCPTestCloudStorage) Get(ctx context.Context, key string) ([]byte, error)
- func (ts *GCPTestCloudStorage) GetReader(ctx context.Context, key string) (io.ReadCloser, error)
- func (ts *GCPTestCloudStorage) GetSignedURL(ctx context.Context, key string, expiry time.Duration) (string, error)
- func (ts *GCPTestCloudStorage) GetWriter(ctx context.Context, key string) (io.WriteCloser, error)
- func (ts *GCPTestCloudStorage) List(ctx context.Context, prefix string) *ListIterator
- func (ts *GCPTestCloudStorage) Write(ctx context.Context, key string, body []byte, contentType *string) error
- type ListIterator
- type ListObject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSCloudStorage ¶
type AWSCloudStorage struct {
// contains filtered or unexported fields
}
func (*AWSCloudStorage) Attributes ¶
func (ts *AWSCloudStorage) Attributes(ctx context.Context, key string) (*Attributes, error)
func (*AWSCloudStorage) Close ¶
func (ts *AWSCloudStorage) Close()
func (*AWSCloudStorage) CreateBucket ¶
func (*AWSCloudStorage) Delete ¶
func (ts *AWSCloudStorage) Delete(ctx context.Context, key string) error
func (*AWSCloudStorage) GetReader ¶ added in v0.0.3
func (ts *AWSCloudStorage) GetReader(ctx context.Context, key string) (io.ReadCloser, error)
func (*AWSCloudStorage) GetSignedURL ¶
func (*AWSCloudStorage) GetWriter ¶ added in v0.0.3
func (ts *AWSCloudStorage) GetWriter(ctx context.Context, key string) (io.WriteCloser, error)
func (*AWSCloudStorage) List ¶
func (ts *AWSCloudStorage) List(ctx context.Context, prefix string) *ListIterator
type AWSTestCloudStorage ¶
type AWSTestCloudStorage struct {
// contains filtered or unexported fields
}
func (*AWSTestCloudStorage) Attributes ¶
func (ts *AWSTestCloudStorage) Attributes(ctx context.Context, key string) (*Attributes, error)
func (*AWSTestCloudStorage) Close ¶
func (ts *AWSTestCloudStorage) Close()
func (*AWSTestCloudStorage) CreateBucket ¶
func (*AWSTestCloudStorage) Delete ¶
func (ts *AWSTestCloudStorage) Delete(ctx context.Context, key string) error
func (*AWSTestCloudStorage) GetReader ¶ added in v0.0.3
func (ts *AWSTestCloudStorage) GetReader(ctx context.Context, key string) (io.ReadCloser, error)
func (*AWSTestCloudStorage) GetSignedURL ¶
func (*AWSTestCloudStorage) GetWriter ¶ added in v0.0.3
func (ts *AWSTestCloudStorage) GetWriter(ctx context.Context, key string) (io.WriteCloser, error)
func (*AWSTestCloudStorage) List ¶
func (ts *AWSTestCloudStorage) List(ctx context.Context, prefix string) *ListIterator
type Attributes ¶
type Attributes struct {
// CacheControl specifies caching attributes that services may use
// when serving the blob.
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
CacheControl string
// ContentDisposition specifies whether the blob content is expected to be
// displayed inline or as an attachment.
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
ContentDisposition string
// ContentEncoding specifies the encoding used for the blob's content, if any.
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
ContentEncoding string
// ContentLanguage specifies the language used in the blob's content, if any.
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language
ContentLanguage string
// ContentType is the MIME type of the blob. It will not be empty.
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type
ContentType string
// Metadata holds key/value pairs associated with the blob.
// Keys are guaranteed to be in lowercase, even if the backend service
// has case-sensitive keys (although note that Metadata written via
// this package will always be lowercased). If there are duplicate
// case-insensitive keys (e.g., "foo" and "FOO"), only one value
// will be kept, and it is undefined which one.
Metadata map[string]string
// ModTime is the time the blob was last modified.
ModTime time.Time
// Size is the size of the blob's content in bytes.
Size int64
// MD5 is an MD5 hash of the blob contents or nil if not available.
MD5 []byte
}
Attributes contains attributes about a blob.
type CloudStorage ¶
type CloudStorage interface {
List(ctx context.Context, prefix string) *ListIterator
Get(ctx context.Context, key string) ([]byte, error)
Delete(ctx context.Context, key string) error
CreateBucket(ctx context.Context, bucketPrefix string, expirationTimeDays int64) error
Close()
GetSignedURL(ctx context.Context, key string, expiry time.Duration) (string, error)
Write(ctx context.Context, key string, body []byte, contentType *string) error
Attributes(ctx context.Context, key string) (*Attributes, error)
GetReader(ctx context.Context, key string) (io.ReadCloser, error)
GetWriter(ctx context.Context, key string) (io.WriteCloser, error)
}
func NewCloudStorage ¶
type GCPCloudStorage ¶
type GCPCloudStorage struct {
// contains filtered or unexported fields
}
func (*GCPCloudStorage) Attributes ¶
func (ts *GCPCloudStorage) Attributes(ctx context.Context, key string) (*Attributes, error)
func (*GCPCloudStorage) Close ¶
func (ts *GCPCloudStorage) Close()
func (*GCPCloudStorage) CreateBucket ¶
func (*GCPCloudStorage) Delete ¶
func (ts *GCPCloudStorage) Delete(ctx context.Context, key string) error
func (*GCPCloudStorage) GetReader ¶ added in v0.0.3
func (ts *GCPCloudStorage) GetReader(ctx context.Context, key string) (io.ReadCloser, error)
func (*GCPCloudStorage) GetSignedURL ¶
func (*GCPCloudStorage) GetWriter ¶ added in v0.0.3
func (ts *GCPCloudStorage) GetWriter(ctx context.Context, key string) (io.WriteCloser, error)
func (*GCPCloudStorage) List ¶
func (ts *GCPCloudStorage) List(ctx context.Context, prefix string) *ListIterator
type GCPTestCloudStorage ¶
type GCPTestCloudStorage struct {
// contains filtered or unexported fields
}
func (*GCPTestCloudStorage) Attributes ¶
func (ts *GCPTestCloudStorage) Attributes(ctx context.Context, key string) (*Attributes, error)
func (*GCPTestCloudStorage) Close ¶
func (ts *GCPTestCloudStorage) Close()
func (*GCPTestCloudStorage) CreateBucket ¶
func (ts *GCPTestCloudStorage) CreateBucket(ctx context.Context, bucketPrefix string, expirationTimeDays int64) error
Create Create the new bucket
func (*GCPTestCloudStorage) Delete ¶
func (ts *GCPTestCloudStorage) Delete(ctx context.Context, key string) error
func (*GCPTestCloudStorage) GetReader ¶ added in v0.0.3
func (ts *GCPTestCloudStorage) GetReader(ctx context.Context, key string) (io.ReadCloser, error)
func (*GCPTestCloudStorage) GetSignedURL ¶
func (*GCPTestCloudStorage) GetWriter ¶ added in v0.0.3
func (ts *GCPTestCloudStorage) GetWriter(ctx context.Context, key string) (io.WriteCloser, error)
func (*GCPTestCloudStorage) List ¶
func (ts *GCPTestCloudStorage) List(ctx context.Context, prefix string) *ListIterator
type ListIterator ¶
type ListIterator struct {
// contains filtered or unexported fields
}
ListIterator iterates over List results.
func (*ListIterator) Next ¶
func (i *ListIterator) Next(ctx context.Context) (*ListObject, error)
type ListObject ¶
type ListObject struct {
// Key is the key for this blob.
Key string
// ModTime is the time the blob was last modified.
ModTime time.Time
// Size is the size of the blob's content in bytes.
Size int64
// MD5 is an MD5 hash of the blob contents or nil if not available.
MD5 []byte
}
ListObject represents a single blob returned from List.
Click to show internal directories.
Click to hide internal directories.