Documentation ¶
Index ¶
- type BlobGCP
- func (b *BlobGCP) Close() error
- func (b *BlobGCP) Delete(ctx context.Context, path string) error
- func (b *BlobGCP) Get(ctx context.Context, path string) ([]byte, error)
- func (b *BlobGCP) NewRangeReader(ctx context.Context, path string, offset, length int64) (io.ReadCloser, error)
- func (b *BlobGCP) NewReader(ctx context.Context, path string) (io.ReadCloser, error)
- func (b *BlobGCP) NewWriter(ctx context.Context, path string) (io.WriteCloser, error)
- func (b *BlobGCP) Put(ctx context.Context, path string, data []byte) error
- func (b *BlobGCP) SignUrl(ctx context.Context, key string, ttlInSeconds int64, method string) (string, error)
- type BlobStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlobGCP ¶
type BlobGCP struct {
// contains filtered or unexported fields
}
BlobGCP is the GCP implementation of blob.BlobStore using Cloud Storage.
func NewBlobGCP ¶
NewBlobGCP returns a new BlobGCP instance.
func (*BlobGCP) NewRangeReader ¶
func (b *BlobGCP) NewRangeReader(ctx context.Context, path string, offset, length int64) (io.ReadCloser, error)
NewRangeReader returns an io.ReadCloser instance for the object specified by path, beginning at the offset-th byte and length bytes long. length = -1 means until EOF. Make sure to close the reader after all operations to the reader.
func (*BlobGCP) NewReader ¶
NewReader is an alias to NewRangeReader(ctx, path, 0, -1), which creates a reader from the beginning of an object to EOF.
func (*BlobGCP) NewWriter ¶
NewWriter creates a new object with path and returns an io.WriteCloser instance for the object. The object is not committed and visible until you close the writer.
type BlobStore ¶
type BlobStore interface { Put(ctx context.Context, path string, data []byte) error // NewWriter creates a new object with path and returns an io.WriteCloser // instance for the object. // Make sure to close the writer after all operations to the writer. NewWriter(ctx context.Context, path string) (io.WriteCloser, error) Get(ctx context.Context, path string) ([]byte, error) // NewReader is an alias to NewRangeReader(ctx, path, 0, -1), which creates // a reader from the beginning of an object to EOF. NewReader(ctx context.Context, path string) (io.ReadCloser, error) // NewRangeReader returns an io.ReadCloser instance for the object specified by path, // beginning at the offset-th byte and length bytes long. length = -1 means until EOF. // Make sure to close the reader after all operations to the reader. NewRangeReader(ctx context.Context, path string, offset, length int64) (io.ReadCloser, error) Delete(ctx context.Context, path string) error SignUrl(ctx context.Context, key string, ttlInSeconds int64, method string) (string, error) }
BlobStore is a public interface for Blob operations within Open Saves. Use one of the structs defined in the package. Currently available drivers: - BlobGCP: Google Cloud Storage