client

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidROWriteOperation = errors.New("the client operates in read only mode. Change 'credentials_source' parameter value ")

ErrInvalidROWriteOperation is returned when credentials associated with the client disallow an attempted write operation.

Functions

This section is empty.

Types

type BlobProperties

type BlobProperties struct {
	ETag          string    `json:"etag,omitempty"`
	LastModified  time.Time `json:"last_modified,omitempty"`
	ContentLength int64     `json:"content_length,omitempty"`
}

type GCSBlobstore

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

GCSBlobstore encapsulates interaction with the GCS blobstore

func New

func New(ctx context.Context, cfg *config.GCSCli) (*GCSBlobstore, error)

New returns a GCSBlobstore configured to operate using the given config

non-nil error is returned on invalid Client or config. If the configuration is incompatible with the GCS bucket, a non-nil error is also returned.

func (*GCSBlobstore) Copy

func (client *GCSBlobstore) Copy(srcBlob string, dstBlob string) error

func (*GCSBlobstore) Delete

func (client *GCSBlobstore) Delete(dest string) error

Delete removes a blob from from the GCS blobstore.

If the object does not exist, Delete returns a nil error.

func (*GCSBlobstore) DeleteRecursive

func (client *GCSBlobstore) DeleteRecursive(prefix string) error

func (*GCSBlobstore) EnsureStorageExists

func (client *GCSBlobstore) EnsureStorageExists() error

func (*GCSBlobstore) Exists

func (client *GCSBlobstore) Exists(dest string) (exists bool, err error)

Exists checks if a blob exists in the GCS blobstore.

func (*GCSBlobstore) Get

func (client *GCSBlobstore) Get(src string, dest string) error

Get fetches a blob from the GCS blobstore. Destination will be overwritten if it already exists.

func (*GCSBlobstore) List

func (client *GCSBlobstore) List(prefix string) ([]string, error)

func (*GCSBlobstore) Properties

func (client *GCSBlobstore) Properties(dest string) error

func (*GCSBlobstore) Put

func (client *GCSBlobstore) Put(sourceFilePath string, dest string) error

Put uploads a blob to the GCS blobstore. Destination will be overwritten if it already exists.

func (*GCSBlobstore) Sign

func (client *GCSBlobstore) Sign(id string, action string, expiry time.Duration) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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