Documentation
¶
Index ¶
- type ConnectOptions
- type Filesystem
- func (b *Filesystem) CanListFiles() bool
- func (b *Filesystem) Close() error
- func (b *Filesystem) Exists(pth string) (bool, error)
- func (b *Filesystem) GetFile(pth string) (io.ReadCloser, error)
- func (b *Filesystem) ListFiles(pth string) (chan string, chan error)
- func (b *Filesystem) PutFile(pth string, in io.ReadCloser) error
- func (b *Filesystem) Size(pth string) (int64, error)
- type GCSStorage
- func (b *GCSStorage) CanListFiles() bool
- func (b *GCSStorage) Close() error
- func (b *GCSStorage) Exists(pth string) (bool, error)
- func (b *GCSStorage) GetFile(pth string) (io.ReadCloser, error)
- func (b *GCSStorage) ListFiles(pth string) (chan string, chan error)
- func (b *GCSStorage) PutFile(pth string, in io.ReadCloser) error
- func (b *GCSStorage) Size(pth string) (int64, error)
- type HttpStorage
- func (b *HttpStorage) CanListFiles() bool
- func (b *HttpStorage) Close() error
- func (b *HttpStorage) Exists(pth string) (bool, error)
- func (b *HttpStorage) GetFile(pth string) (io.ReadCloser, error)
- func (b *HttpStorage) Head(pth string) (*http.Response, error)
- func (b *HttpStorage) ListFiles(pth string) (chan string, chan error)
- func (b *HttpStorage) PutFile(pth string, in io.ReadCloser) error
- func (b *HttpStorage) Size(pth string) (int64, error)
- type S3Storage
- func (b *S3Storage) CanListFiles() bool
- func (b *S3Storage) Close() error
- func (b *S3Storage) Exists(pth string) (bool, error)
- func (b *S3Storage) GetACLWriteRule() string
- func (b *S3Storage) GetFile(pth string) (io.ReadCloser, error)
- func (b *S3Storage) Head(pth string) (*http.Response, error)
- func (b *S3Storage) ListFiles(pth string) (chan string, chan error)
- func (b *S3Storage) PutFile(pth string, in io.ReadCloser) error
- func (b *S3Storage) Size(pth string) (int64, error)
- type Storage
- func ConnectBackend(u string, opts ConnectOptions) (Storage, error)
- func NewFilesystemStorage(pth string) Storage
- func NewGCSBackend(ctx context.Context, bucketName string, prefix string, endpoint string) (Storage, error)
- func NewHttpStorage(ctx context.Context, base *url.URL, userAgent string) Storage
- func NewS3Storage(ctx context.Context, bucket string, prefix string, region string, ...) (Storage, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectOptions ¶
type ConnectOptions struct {
Context context.Context
S3Region string
S3Endpoint string
UnsignedRequests bool
GCSEndpoint string
// When putting file object to s3 bucket, specify the ACL for the object.
S3WriteACL string
// UserAgent is the value of `User-Agent` header. Applicable only for HTTP
// client.
UserAgent string
}
type Filesystem ¶
type Filesystem struct {
// contains filtered or unexported fields
}
func (*Filesystem) CanListFiles ¶
func (b *Filesystem) CanListFiles() bool
func (*Filesystem) Close ¶
func (b *Filesystem) Close() error
func (*Filesystem) GetFile ¶
func (b *Filesystem) GetFile(pth string) (io.ReadCloser, error)
func (*Filesystem) PutFile ¶
func (b *Filesystem) PutFile(pth string, in io.ReadCloser) error
type GCSStorage ¶
type GCSStorage struct {
// contains filtered or unexported fields
}
func (*GCSStorage) CanListFiles ¶
func (b *GCSStorage) CanListFiles() bool
func (*GCSStorage) Close ¶
func (b *GCSStorage) Close() error
func (*GCSStorage) GetFile ¶
func (b *GCSStorage) GetFile(pth string) (io.ReadCloser, error)
func (*GCSStorage) PutFile ¶
func (b *GCSStorage) PutFile(pth string, in io.ReadCloser) error
type HttpStorage ¶
type HttpStorage struct {
// contains filtered or unexported fields
}
func (*HttpStorage) CanListFiles ¶
func (b *HttpStorage) CanListFiles() bool
func (*HttpStorage) Close ¶
func (b *HttpStorage) Close() error
func (*HttpStorage) GetFile ¶
func (b *HttpStorage) GetFile(pth string) (io.ReadCloser, error)
func (*HttpStorage) ListFiles ¶
func (b *HttpStorage) ListFiles(pth string) (chan string, chan error)
func (*HttpStorage) PutFile ¶
func (b *HttpStorage) PutFile(pth string, in io.ReadCloser) error
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
func (*S3Storage) CanListFiles ¶
func (*S3Storage) GetACLWriteRule ¶
type Storage ¶
type Storage interface {
Exists(path string) (bool, error)
Size(path string) (int64, error)
GetFile(path string) (io.ReadCloser, error)
PutFile(path string, in io.ReadCloser) error
ListFiles(path string) (chan string, chan error)
CanListFiles() bool
Close() error
}
func ConnectBackend ¶
func ConnectBackend(u string, opts ConnectOptions) (Storage, error)
func NewFilesystemStorage ¶
func NewGCSBackend ¶
func NewHttpStorage ¶
Click to show internal directories.
Click to hide internal directories.