Documentation ¶
Index ¶
- type StorageClient
- func (g *StorageClient) AllFilesInDirectory(ctx context.Context, prefix string, ...) error
- func (g *StorageClient) Bucket() string
- func (g *StorageClient) DeleteFile(ctx context.Context, path string) error
- func (g *StorageClient) DoesFileExist(ctx context.Context, path string) (bool, error)
- func (g *StorageClient) FileReader(ctx context.Context, path string) (io.ReadCloser, error)
- func (g *StorageClient) FileWriter(ctx context.Context, path string, opts gcs.FileWriteOptions) io.WriteCloser
- func (g *StorageClient) GetFileContents(ctx context.Context, path string) ([]byte, error)
- func (g *StorageClient) GetFileObjectAttrs(ctx context.Context, path string) (*storage.ObjectAttrs, error)
- func (g *StorageClient) SetFileContents(ctx context.Context, path string, opts gcs.FileWriteOptions, contents []byte) (rv error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StorageClient ¶
type StorageClient struct {
// contains filtered or unexported fields
}
StorageClient holds the information needed to talk to cloud storage and fulfill the gcs.GCSClient interface
func New ¶
func New(s *storage.Client, bucket string) *StorageClient
New returns a new *StorageClient. See the gcs.GCSClient interface for more information.
func (*StorageClient) AllFilesInDirectory ¶
func (g *StorageClient) AllFilesInDirectory(ctx context.Context, prefix string, callback func(item *storage.ObjectAttrs) error) error
See the GCSClient interface for more information about AllFilesInDirectory.
func (*StorageClient) Bucket ¶
func (g *StorageClient) Bucket() string
See the GCSClient interface for more information about Bucket.
func (*StorageClient) DeleteFile ¶
func (g *StorageClient) DeleteFile(ctx context.Context, path string) error
See the GCSClient interface for more information about DeleteFile.
func (*StorageClient) DoesFileExist ¶
See the GCSClient interface for more information about DoesFileExist.
func (*StorageClient) FileReader ¶
func (g *StorageClient) FileReader(ctx context.Context, path string) (io.ReadCloser, error)
See the GCSClient interface for more information about FileReader.
func (*StorageClient) FileWriter ¶
func (g *StorageClient) FileWriter(ctx context.Context, path string, opts gcs.FileWriteOptions) io.WriteCloser
See the GCSClient interface for more information about FileWriter.
func (*StorageClient) GetFileContents ¶
See the GCSClient interface for more information about GetFileContents.
func (*StorageClient) GetFileObjectAttrs ¶
func (g *StorageClient) GetFileObjectAttrs(ctx context.Context, path string) (*storage.ObjectAttrs, error)
See the GCSClient interface for more information about GetFileObjectAttrs.
func (*StorageClient) SetFileContents ¶
func (g *StorageClient) SetFileContents(ctx context.Context, path string, opts gcs.FileWriteOptions, contents []byte) (rv error)
See the GCSClient interface for more information about SetFileContents.