gcs

package
v0.26.6 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: 0BSD Imports: 6 Imported by: 0

Documentation

Overview

Package gcs implements goproxy.Cacher backed by Google Cloud Storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

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

Cacher implements goproxy.Cacher using GCS.

func New

func New(ctx context.Context, cfg Config) (*Cacher, error)

New creates a GCS-backed Cacher.

func (*Cacher) BucketName

func (c *Cacher) BucketName() string

BucketName returns the GCS bucket name.

func (*Cacher) Close

func (c *Cacher) Close() error

Close releases GCS client resources.

func (*Cacher) Get

func (c *Cacher) Get(ctx context.Context, name string) (io.ReadCloser, error)

Get retrieves a cached module file.

func (*Cacher) Put

func (c *Cacher) Put(ctx context.Context, name string, content io.ReadSeeker) error

Put stores a module file in GCS.

func (*Cacher) StorageClient

func (c *Cacher) StorageClient() *storage.Client

StorageClient returns the underlying GCS client.

type Config

type Config struct {
	Bucket          string
	ProjectID       string
	CredentialsFile string
}

Config holds GCS connection parameters.

Jump to

Keyboard shortcuts

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