Documentation ¶
Overview ¶
Convenience functions for working with types from package gcs.
Index ¶
- func CRC32C(contents []byte) *uint32
- func CreateEmptyObjects(ctx context.Context, bucket gcs.Bucket, names []string) (err error)
- func CreateObject(ctx context.Context, bucket gcs.Bucket, name string, contents []byte) (*gcs.Object, error)
- func CreateObjects(ctx context.Context, bucket gcs.Bucket, input map[string][]byte) (err error)
- func DeleteAllObjects(ctx context.Context, bucket gcs.Bucket) error
- func ListAll(ctx context.Context, bucket gcs.Bucket, req *gcs.ListObjectsRequest) (objects []*gcs.Object, runs []string, err error)
- func ListPrefix(ctx context.Context, bucket gcs.Bucket, prefix string, ...) (err error)
- func MD5(contents []byte) *[md5.Size]byte
- func ReadObject(ctx context.Context, bucket gcs.Bucket, name string) (contents []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CRC32C ¶
Return a value appropriate for placing in CreateObjectRequest.CRC32C for the given object contents.
func CreateEmptyObjects ¶
Create empty objects with default attributes for all of the supplied names.
func CreateObject ¶
func CreateObject( ctx context.Context, bucket gcs.Bucket, name string, contents []byte) (*gcs.Object, error)
Create an object with the supplied contents in the given bucket with the given name.
func CreateObjects ¶
Create multiple objects with some parallelism, with contents according to the supplied map from name to contents.
func DeleteAllObjects ¶
Delete all objects from the supplied bucket. Results are undefined if the bucket is being concurrently updated.
func ListAll ¶
func ListAll( ctx context.Context, bucket gcs.Bucket, req *gcs.ListObjectsRequest) ( objects []*gcs.Object, runs []string, err error)
Repeatedly call bucket.ListObjects until there is nothing further to list, returning all objects and collapsed runs encountered.
May modify *req.
func ListPrefix ¶
func ListPrefix( ctx context.Context, bucket gcs.Bucket, prefix string, objects chan<- *gcs.Object) (err error)
List objects in the supplied bucket whose name starts with the given prefix. Write them into the supplied channel in an undefined order.
Types ¶
This section is empty.