store

package
v0.0.0-...-ed70e32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ObjAttrsOptions objectAttrsOptions

Functions

This section is empty.

Types

type BucketStorer

type BucketStorer struct {
	// contains filtered or unexported fields
}

func NewBucketStorer

func NewBucketStorer(c *storage.Client, bucketName string) BucketStorer

func (BucketStorer) Exists

func (s BucketStorer) Exists(ctx context.Context, objName string) (bool, error)

Exists checks if an object exists in the bucket

func (BucketStorer) ExistsRetry

func (s BucketStorer) ExistsRetry(ctx context.Context, objName string) (exists bool, err error)

ExistsRetry checks if an object exists, but retries on Unauthorized errors. While writes to GCP are strongly consistent, access is only eventually consistent: https://cloud.google.com/storage/docs/consistency. and can take up to several minutes to take effect.

func (BucketStorer) Metadata

func (s BucketStorer) Metadata(ctx context.Context, objName string) (*storage.ObjectAttrs, error)

func (BucketStorer) NewReader

func (s BucketStorer) NewReader(ctx context.Context, objName string) (*storage.Reader, error)

func (BucketStorer) NewWriter

func (s BucketStorer) NewWriter(ctx context.Context, objName string, opts ...func(*storage.ObjectAttrs)) *storage.Writer

func (BucketStorer) Write

func (s BucketStorer) Write(ctx context.Context, objName string, b []byte, opts ...func(*storage.ObjectAttrs)) (int, error)

func (BucketStorer) WriteGzip

func (s BucketStorer) WriteGzip(ctx context.Context, objName string, b []byte, opts ...func(*storage.ObjectAttrs)) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL