Documentation ¶
Overview ¶
Package gcs provides the Google Cloud Storage disk implementation.
Index ¶
- Constants
- func NewAutoWire(ctx context.Context, cfg map[string]interface{}) (godrive.Disk, error)
- func Register(cfg *godrive.AutoWireConfig)
- type Config
- type Disk
- func (d *Disk) Delete(ctx context.Context, path string) error
- func (d *Disk) Get(ctx context.Context, path string) ([]byte, error)
- func (d *Disk) GetURL(_ context.Context, path string) (string, error)
- func (d *Disk) Put(ctx context.Context, path string, b []byte) error
- func (d *Disk) PutReader(ctx context.Context, path string, r io.Reader) error
- type InvalidConfigValueError
- type Option
Constants ¶
const (
// DefaultURLTemplate is the default URL template to use for (*Disk).GetURL().
DefaultURLTemplate = "https://storage.googleapis.com/{{ .Bucket }}/{{ .Path }}"
)
const (
// Provider is the provider name for Google Cloud Storage.
Provider = "gcs"
)
Variables ¶
This section is empty.
Functions ¶
func NewAutoWire ¶ added in v0.3.0
NewAutoWire creates a new Google Cloud Storage disk from an autowire configuration.
func Register ¶ added in v0.3.0
func Register(cfg *godrive.AutoWireConfig)
Register registeres Google Cloud Storage as a provider for the disk autowire.
Types ¶
type Disk ¶
Disk is the Google Cloud Storage disk.
type InvalidConfigValueError ¶ added in v0.3.0
InvalidConfigValueError means the autowire configuration has an invalid config value.
func (InvalidConfigValueError) Error ¶ added in v0.3.0
func (err InvalidConfigValueError) Error() string
type Option ¶
type Option func(*Config)
Option is a disk configuration option.
func Public ¶
Public configures the disk to make all uploaded files publicly accessible. Note that this option will not work and storing files will return an error if "uniform bucket-level access" is configured on the bucket, because individual ACL for specific objects is not available for those buckets.
func URLTemplate ¶ added in v0.4.1
URLTemplate overrides the default template for public URLs.