gcs

package
v0.0.0-...-9110a8e Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCSOption

type GCSOption func(o *Handler)

Option is an option that can be passed to RegisterHandler

func GCSBillingProject

func GCSBillingProject(projectID string) GCSOption

BillingProject sets the project name which should be billed for the requests. This is mandatory if the bucket is in requester-pays mode.

func GCSClient

func GCSClient(cl *storage.Client) GCSOption

Client sets the cloud.google.com/go/storage.Client that will be used by the handler

type Handler

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

func Handle

func Handle(ctx context.Context, opts ...GCSOption) (*Handler, error)

Handle creates a KeyStreamerAt suitable for constructing an Adapter that accesses objects on Google Cloud Storage

func (*Handler) ReadAt

func (gcs *Handler) ReadAt(key string, p []byte, off int64) (int, int64, error)

func (*Handler) StreamAt

func (gcs *Handler) StreamAt(key string, off int64, n int64) (io.ReadCloser, int64, error)

Jump to

Keyboard shortcuts

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