ategcs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchFromGCS

func FetchFromGCS(ctx context.Context, client ObjectStorage, gsURL string) ([]byte, error)

func FetchLocalFileFromGCSWithZstd

func FetchLocalFileFromGCSWithZstd(ctx context.Context, client ObjectStorage, gsURL string, localFilePath string) (err error)

func Open

func Open(ctx context.Context, client ObjectStorage, gsURL string) (io.ReadCloser, error)

Open streams the object at gsURL; the caller must Close the returned reader. Unlike FetchFromGCS it does not buffer the whole object in memory.

func SendBytesToGCS

func SendBytesToGCS(ctx context.Context, client ObjectStorage, gsURL string, content []byte) error

SendBytesToGCS uploads the given bytes (uncompressed) to gsURL. Intended for small objects such as the snapshot manifest.

func SendLocalFileToGCSWithZstd

func SendLocalFileToGCSWithZstd(ctx context.Context, client ObjectStorage, gsURL string, localFilePath string) (err error)

Types

type ObjectStorage

type ObjectStorage interface {
	GetObject(ctx context.Context, bucket, object string) (io.ReadCloser, error)
	PutObject(ctx context.Context, bucket, object string, reader io.Reader) error
}

func NewGCSClient

func NewGCSClient(ctx context.Context, opts ...option.ClientOption) (ObjectStorage, error)

NewGCSClient returns a GCS-backed ObjectStorage. It builds its own storage.Client from opts (and more from the same opts for the part-upload pool, see uploadClient) rather than accepting one, because it installs a RetryAlways policy (see setRetry) that is only safe for this package's own operations and must not leak onto a client shared with other code.

func NewS3Client

func NewS3Client(client *s3.Client) ObjectStorage

Jump to

Keyboard shortcuts

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