gcsstorage

package module
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) (storagecore.Storage, error)

New constructs GCS-backed storage using cloud.google.com/go/storage. @group Driver Constructors

Example: gcs storage

fs, _ := gcsstorage.New(gcsstorage.Config{
	Bucket: "uploads",
})
_ = fs

func NewContext

func NewContext(ctx context.Context, cfg Config) (storagecore.Storage, error)

Types

type Config

type Config struct {
	Bucket          string
	CredentialsJSON string
	Endpoint        string
	Prefix          string
}

Config defines a GCS-backed storage disk. @group Driver Config

Example: define gcs storage config

cfg := gcsstorage.Config{
	Bucket: "uploads",
}
_ = cfg

Example: define gcs storage config with all fields

cfg := gcsstorage.Config{
	Bucket:          "uploads",
	CredentialsJSON: "{...}",              // default: ""
	Endpoint:        "http://127.0.0.1:0", // default: ""
	Prefix:          "assets",             // default: ""
}
_ = cfg

func (Config) DriverName

func (Config) DriverName() string

func (Config) ResolvedConfig

func (c Config) ResolvedConfig() storagecore.ResolvedConfig

Jump to

Keyboard shortcuts

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