Documentation
¶
Overview ¶
Package gcs implements the create-only Destination for Google Cloud Storage. WORM is a locked bucket retention policy (Bucket Lock); writes are create-only and inherit it. Auth uses Application Default Credentials. There is no delete path.
Index ¶
- type Backend
- func (b *Backend) Get(ctx context.Context, key string) (io.ReadCloser, error)
- func (b *Backend) List(ctx context.Context, prefix string) ([]dest.Object, error)
- func (b *Backend) PutImmutable(ctx context.Context, key string, r io.Reader, _ int64, _ dest.Retention) (dest.PutResult, error)
- func (b *Backend) VerifyWorm(ctx context.Context) (dest.WormStatus, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is a create-only GCS Destination.
func (*Backend) PutImmutable ¶
func (b *Backend) PutImmutable(ctx context.Context, key string, r io.Reader, _ int64, _ dest.Retention) (dest.PutResult, error)
PutImmutable creates key. Create-only via the DoesNotExist precondition; immutability is enforced by the bucket's locked retention policy. Never overwrites, never deletes.
func (*Backend) VerifyWorm ¶
VerifyWorm requires a locked bucket retention policy. An unlocked or absent policy is reported as not-locked so the operator can override.
type Options ¶
type Options struct {
Bucket string
Endpoint string // empty = real GCS; set for an emulator, e.g. http://host:4443/storage/v1/
}
Options configures the GCS backend. Credentials come from ADC (not set here).