gcs

package
v0.1.31 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(ctx context.Context, bucketname string, filename string) (bool, error)

func ListBucket added in v0.1.31

func ListBucket(ctx context.Context, bucketname string) ([]string, error)

OpenBucket returns a handle that can read a bucket, but the bucket must already exist.

Types

type RWHandle

type RWHandle struct {
	Bucket *storage.BucketHandle
	Reader *storage.Reader
	Writer *storage.Writer
	Client *storage.Client
}

func OpenR added in v0.1.29

func OpenR(ctx context.Context, bucketname string, filename string) (*RWHandle, error)

func OpenRW

func OpenRW(ctx context.Context, bucketname string, filename string, contentType string) (*RWHandle, error)

This appears to truncate contents :/

func (*RWHandle) Close

func (h *RWHandle) Close() error

IMPORTANT - if you don't call this (and see it return nil), your data is likely lost

func (*RWHandle) IOReader added in v0.1.24

func (h *RWHandle) IOReader() io.Reader

func (*RWHandle) IOWriter

func (h *RWHandle) IOWriter() io.Writer

func (*RWHandle) ToReader added in v0.1.28

func (h *RWHandle) ToReader(ctx context.Context, bucketname, filename string) (io.Reader, error)

Jump to

Keyboard shortcuts

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