Help us shape the future of Go! Take the 2026 Go Developer Survey

storage

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, bucket string, opts ...option.ClientOption) (*Client, error)

func (*Client) Close

func (x *Client) Close(ctx context.Context)

func (*Client) CopyObject added in v0.16.0

func (x *Client) CopyObject(ctx context.Context, src, dst string) error

CopyObject copies src to dst inside the same bucket using GCS's server-side copy API. No bytes traverse the caller's process; the rewrite runs entirely on Google's side. A missing source surfaces as storage.ErrObjectNotExist, wrapped so callers can discriminate.

func (*Client) DeleteObject added in v0.16.0

func (x *Client) DeleteObject(ctx context.Context, object string) error

func (*Client) GetObject

func (x *Client) GetObject(ctx context.Context, object string) (io.ReadCloser, error)

func (*Client) PutObject

func (x *Client) PutObject(ctx context.Context, object string) io.WriteCloser

type MemoryClient added in v0.1.0

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

func NewMemoryClient added in v0.1.0

func NewMemoryClient() *MemoryClient

func (*MemoryClient) Close added in v0.1.0

func (m *MemoryClient) Close(ctx context.Context)

func (*MemoryClient) CopyObject added in v0.16.0

func (m *MemoryClient) CopyObject(_ context.Context, src, dst string) error

CopyObject copies the in-memory object bytes. The test helper does not attempt to mimic GCS's "stage-then-commit" semantics; it just duplicates the byte slice so the destination is independent of later writes to the source.

func (*MemoryClient) DeleteObject added in v0.16.0

func (m *MemoryClient) DeleteObject(_ context.Context, object string) error

func (*MemoryClient) GetObject added in v0.1.0

func (m *MemoryClient) GetObject(ctx context.Context, object string) (io.ReadCloser, error)

func (*MemoryClient) PutObject added in v0.1.0

func (m *MemoryClient) PutObject(ctx context.Context, object string) io.WriteCloser

type Mock

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

func NewMock

func NewMock() *Mock

func (*Mock) Close

func (m *Mock) Close(_ context.Context)

func (*Mock) CopyObject added in v0.16.0

func (m *Mock) CopyObject(_ context.Context, src, dst string) error

func (*Mock) DeleteObject added in v0.16.0

func (m *Mock) DeleteObject(_ context.Context, object string) error

func (*Mock) GetObject

func (m *Mock) GetObject(ctx context.Context, object string) (io.ReadCloser, error)

func (*Mock) PutObject

func (m *Mock) PutObject(ctx context.Context, object string) io.WriteCloser

Jump to

Keyboard shortcuts

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