gcpstorage

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 54 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Google Cloud Storage

Parity grade: B · SDK cloud.google.com/go/storage@v1.69.0 · last audited 2026-10-18 (3a537de68)

Coverage

Metric Value
PARITY entries audited 39 (35 ok, 4 partial)
Feature families 12 (11 ok, 1 partial)
Known gaps 4
Deferred items 0
Resource leaks clean
Known gaps
  • ACLs are stored, never evaluated. Entities are not resolved (no entityId), uploads are attributed to a fixed emulator identity, and project team entities use a project number derived from the project id.
  • No bucket relocation (buckets.relocate and the bucket operations resource) or restoreToken (hierarchical-namespace restore): google.golang.org/api storage/v1 gives the request shapes (RelocateBucketRequest, GoogleLongrunningOperation, Operations get/list/cancel/advanceRelocateBucket) but neither it nor the buckets.relocate and bucket-relocation overview pages define the operation metadata and response, its states or its failure modes, and restoreToken exists only on hierarchical-namespace buckets, whose folders API (folders.insert/get/list/delete/deleteRecursive/rename) and managed folders are not modelled.
  • XML listing does not support versions=, uploads or the service-level bucket list, and XML multipart uploads do not serve list parts or list uploads (the XML pages read for this pass document only initiate, upload part, complete and abort).
  • Managed and hierarchical-namespace folders are not modelled, so includeFoldersAsPrefixes (validated: delimiter must be '/') adds no prefixes; the objects.list page says it includes empty folders and managed folders in prefixes[] (docs.cloud.google.com/storage/docs/json_api/v1/objects/list), which needs the managed folders API (ManagedFolder, managedFolders insert/get/list/delete/update) and the HNS folders API.

More

Documentation

Index

Constants

View Source
const DefaultPort = 4443

DefaultPort is the dedicated listener's default TCP port.

Variables

View Source
var ErrNilAppContext = errors.New("gcpstorage: nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

View Source
var ErrSnapshotBucketNull = errors.New("gcpstorage: restore snapshot: bucket is null")

ErrSnapshotBucketNull is returned by Restore when a snapshot holds a null bucket.

Functions

func LocationType

func LocationType(loc string) string

LocationType returns the GCS locationType of a bucket location.

Types

type ACLEntry

type ACLEntry struct {
	Entity string `json:"entity"`
	Role   string `json:"role"`
}

ACLEntry is one access-control entry; the derived fields (email, domain, projectTeam) are rendered from Entity.

type APIError

type APIError struct {
	XMLCode string
	Reason  string
	Message string
	Status  int
}

APIError is an error carrying the HTTP status and Google error reason.

func (*APIError) Error

func (e *APIError) Error() string

Error implements error.

type Bucket

type Bucket struct {
	Created               time.Time                 `json:"created"`
	Updated               time.Time                 `json:"updated"`
	SoftDeleteTime        time.Time                 `json:"softDeleteTime,omitzero"`
	HardDeleteTime        time.Time                 `json:"hardDeleteTime,omitzero"`
	Objects               map[string][]*Object      `json:"objects"`
	SoftDeleted           []*Object                 `json:"softDeleted,omitempty"`
	Notifications         []Notification            `json:"notifications,omitempty"`
	Labels                map[string]string         `json:"labels,omitempty"`
	Config                map[string]jsontext.Value `json:"config,omitempty"`
	Project               string                    `json:"project"`
	Name                  string                    `json:"name"`
	Location              string                    `json:"location"`
	StorageClass          string                    `json:"storageClass"`
	ACL                   []ACLEntry                `json:"acl,omitempty"`
	DefaultObjectACL      []ACLEntry                `json:"defaultObjectAcl,omitempty"`
	IAM                   IAMPolicy                 `json:"iam"`
	Metageneration        int64                     `json:"metageneration"`
	Generation            int64                     `json:"generation,omitempty"`
	NotifSeq              int64                     `json:"notifSeq,omitempty"`
	Versioning            bool                      `json:"versioning,omitempty"`
	DefaultEventBasedHold bool                      `json:"defaultEventBasedHold,omitempty"`
}

Bucket is a bucket with all of its object versions.

type ComposeSource

type ComposeSource struct {
	Pre        Preconds
	Name       string
	Generation int64
}

ComposeSource is one source object of a compose request.

type ConfigProvider

type ConfigProvider interface {
	GetGCPStorageSettings() Settings
}

ConfigProvider extracts GCS configuration from the AppContext Config.

type CopyRequest

type CopyRequest struct {
	DstPre        Preconds
	SrcPre        Preconds
	Meta          Patch
	ACL           Patch
	SrcBucket     string
	SrcName       string
	DstBucket     string
	DstName       string
	SrcKeySHA     string
	DstKeySHA     string
	DstKMSKey     string
	SrcGeneration int64
}

CopyRequest describes a copy or rewrite.

type HMACKey

type HMACKey struct {
	Created             time.Time `json:"created"`
	Updated             time.Time `json:"updated"`
	AccessID            string    `json:"accessId"`
	Secret              string    `json:"secret"`
	Project             string    `json:"project"`
	ServiceAccountEmail string    `json:"serviceAccountEmail"`
	State               string    `json:"state"`
}

HMACKey is a Cloud Storage HMAC key (storage#hmacKeyMetadata plus its secret).

type Handler

type Handler struct {
	Backend *InMemoryBackend

	Port int
	// RequireAuth rejects requests that are neither signed nor carry an Authorization header.
	RequireAuth bool
	// contains filtered or unexported fields
}

Handler serves the Cloud Storage JSON and XML APIs.

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

NewHandler creates a Handler; callers override Port from Settings.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

ExtractOperation returns the operation name for metrics.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

ExtractResource returns bucket[/object] for metrics.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations lists the supported operations.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns the Echo handler for all GCS requests.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority is irrelevant because RouteMatcher never matches.

func (*Handler) Name

func (h *Handler) Name() string

Name returns the service name.

func (*Handler) Reset

func (h *Handler) Reset()

Reset clears all in-memory state.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher never matches: GCS runs on its own listener.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown stops the dedicated listener, forcing a close if graceful shutdown fails.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker binds the dedicated listener synchronously so a port conflict is returned to the caller.

type IAMBinding

type IAMBinding struct {
	Condition jsontext.Value `json:"condition,omitempty"`
	Role      string         `json:"role"`
	Members   []string       `json:"members"`
}

IAMBinding is one role binding of a bucket IAM policy.

type IAMPolicy

type IAMPolicy struct {
	Etag     string       `json:"etag"`
	Bindings []IAMBinding `json:"bindings"`
	Version  int          `json:"version"`
}

IAMPolicy is a bucket IAM policy.

type InMemoryBackend

type InMemoryBackend struct {

	// Audit records Cloud Audit Logs entries for bucket and object changes.
	Audit gcpaudit.Emitter
	// contains filtered or unexported fields
}

InMemoryBackend holds all buckets, objects and resumable upload sessions under one lock.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates an empty backend.

func (*InMemoryBackend) AbortMultipart

func (b *InMemoryBackend) AbortMultipart(bucket, name, id string) error

AbortMultipart discards an upload and its parts.

func (*InMemoryBackend) AddNotification

func (b *InMemoryBackend) AddNotification(bucket string, n Notification) (Notification, error)

AddNotification validates and stores a notificationConfig; the topic must exist.

func (*InMemoryBackend) AppendUpload

func (b *InMemoryBackend) AppendUpload(id string, offset int64, chunk []byte, total int64) (UploadProgress, error)

AppendUpload appends chunk at offset. total is the declared object size or -1 when unknown; once the received bytes reach it the object is committed.

func (*InMemoryBackend) BucketLocation

func (b *InMemoryBackend) BucketLocation(name string) (string, bool)

BucketLocation returns the location of a bucket, and false when it does not exist.

func (*InMemoryBackend) BucketProject

func (b *InMemoryBackend) BucketProject(name string) (string, bool)

BucketProject returns the project that owns a bucket, and false when it does not exist.

func (*InMemoryBackend) CancelUpload

func (b *InMemoryBackend) CancelUpload(id string) error

CancelUpload discards a resumable session.

func (*InMemoryBackend) CompleteMultipart

func (b *InMemoryBackend) CompleteMultipart(
	bucket, name, id string, parts []PartRef, pre Preconds, keySHA string,
) (*Object, error)

CompleteMultipart assembles the listed parts into the object and discards the upload.

func (*InMemoryBackend) ComposeObject

func (b *InMemoryBackend) ComposeObject(
	bucket, dst string, sources []ComposeSource, meta Patch, pre Preconds, keySHA string,
) (*Object, error)

ComposeObject concatenates sources (same bucket) into dst.

func (*InMemoryBackend) CopyObject

func (b *InMemoryBackend) CopyObject(req CopyRequest) (*Object, error)

CopyObject copies an object. A nil Meta inherits the source metadata; otherwise Meta supplies the destination metadata.

func (*InMemoryBackend) CreateBucket

func (b *InMemoryBackend) CreateBucket(project string, p Patch) (*Bucket, error)

CreateBucket creates a bucket in project from the request body p.

func (*InMemoryBackend) CreateHMACKey

func (b *InMemoryBackend) CreateHMACKey(project, email string) (*HMACKey, error)

CreateHMACKey creates an ACTIVE key for a service account; the returned copy carries the secret.

func (*InMemoryBackend) DeleteACL

func (b *InMemoryBackend) DeleteACL(t aclTarget, entity string) error

DeleteACL removes the entry for entity.

func (*InMemoryBackend) DeleteBucket

func (b *InMemoryBackend) DeleteBucket(name string, pre Preconds) error

DeleteBucket deletes an empty bucket.

func (*InMemoryBackend) DeleteHMACKey

func (b *InMemoryBackend) DeleteHMACKey(project, id string) error

DeleteHMACKey marks an INACTIVE key DELETED.

func (*InMemoryBackend) DeleteNotification

func (b *InMemoryBackend) DeleteNotification(bucket, id string) error

DeleteNotification removes a notificationConfig.

func (*InMemoryBackend) DeleteObject

func (b *InMemoryBackend) DeleteObject(bucket, name string, gen int64, pre Preconds) error

DeleteObject deletes the live version (archiving it in a versioned bucket) or, with gen set, permanently removes that generation.

func (*InMemoryBackend) GetACL

func (b *InMemoryBackend) GetACL(t aclTarget, entity string) (ACLEntry, int64, error)

GetACL returns the entry for entity.

func (*InMemoryBackend) GetBucket

func (b *InMemoryBackend) GetBucket(name string, pre Preconds) (*Bucket, error)

GetBucket returns the bucket metadata.

func (*InMemoryBackend) GetHMACKey

func (b *InMemoryBackend) GetHMACKey(project, id string) (*HMACKey, error)

GetHMACKey returns key metadata (the secret is blanked).

func (*InMemoryBackend) GetIAMPolicy

func (b *InMemoryBackend) GetIAMPolicy(name string, requestedVersion int) (IAMPolicy, error)

GetIAMPolicy returns the bucket IAM policy; policies with conditional bindings need requestedVersion >= 3.

func (*InMemoryBackend) GetNotification

func (b *InMemoryBackend) GetNotification(bucket, id string) (Notification, error)

GetNotification returns one notificationConfig.

func (*InMemoryBackend) GetObject

func (b *InMemoryBackend) GetObject(bucket, name string, gen int64, pre Preconds) (*Object, error)

GetObject returns generation gen of an object, or the live one when gen is 0.

func (*InMemoryBackend) GetSoftDeletedBucket

func (b *InMemoryBackend) GetSoftDeletedBucket(name string, gen int64) (*Bucket, error)

GetSoftDeletedBucket returns generation gen of a soft-deleted bucket.

func (*InMemoryBackend) GetSoftDeletedObject

func (b *InMemoryBackend) GetSoftDeletedObject(bucket, name string, gen int64) (*Object, error)

GetSoftDeletedObject returns a soft-deleted generation.

func (*InMemoryBackend) InitiateMultipart

func (b *InMemoryBackend) InitiateMultipart(bucket, name string, meta Patch) (string, error)

InitiateMultipart opens an XML API multipart upload and returns its upload id.

func (*InMemoryBackend) ListACL

func (b *InMemoryBackend) ListACL(t aclTarget) ([]ACLEntry, int64, error)

ListACL returns the entries of the targeted ACL and the resolved object generation.

func (*InMemoryBackend) ListBuckets

func (b *InMemoryBackend) ListBuckets(project, prefix, token string, limit int) page.Page[*Bucket]

ListBuckets lists the project's buckets whose names start with prefix.

func (*InMemoryBackend) ListHMACKeys

func (b *InMemoryBackend) ListHMACKeys(
	project, email, token string, limit int, showDeleted bool,
) page.Page[*HMACKey]

ListHMACKeys lists a project's keys, optionally for one service account and including DELETED ones.

func (*InMemoryBackend) ListNotifications

func (b *InMemoryBackend) ListNotifications(bucket string) ([]Notification, error)

ListNotifications returns a bucket's notificationConfigs.

func (*InMemoryBackend) ListObjects

func (b *InMemoryBackend) ListObjects(bucket string, opts ListOptions) (ListResult, error)

ListObjects lists objects in name order, collapsing delimited prefixes.

func (*InMemoryBackend) ListSoftDeletedBuckets

func (b *InMemoryBackend) ListSoftDeletedBuckets(project, prefix, token string, limit int) page.Page[*Bucket]

ListSoftDeletedBuckets lists the project's soft-deleted bucket generations.

func (*InMemoryBackend) LockRetentionPolicy

func (b *InMemoryBackend) LockRetentionPolicy(name string, metageneration int64) (*Bucket, error)

LockRetentionPolicy irreversibly locks the bucket's retention policy.

func (*InMemoryBackend) NoteRead

func (b *InMemoryBackend) NoteRead(bucket, name string, gen int64)

NoteRead records a data read of an object; Autoclass returns the object to Standard storage on a read.

func (*InMemoryBackend) ObserveObjects

func (b *InMemoryBackend) ObserveObjects(fn ObjectObserver)

ObserveObjects registers fn to see every object change from now on.

func (*InMemoryBackend) PutObject

func (b *InMemoryBackend) PutObject(bucket, name string, data []byte, p Patch, pre Preconds) (*Object, error)

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all state.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a snapshot.

func (*InMemoryBackend) RestoreBucket

func (b *InMemoryBackend) RestoreBucket(name string, gen int64) (*Bucket, error)

RestoreBucket brings a soft-deleted bucket back under its original name.

func (*InMemoryBackend) RestoreObject

func (b *InMemoryBackend) RestoreObject(
	bucket, name string, gen int64, pre Preconds, copySourceACL bool,
) (*Object, error)

RestoreObject makes a soft-deleted generation live again as a new generation.

func (*InMemoryBackend) RunJanitor

func (b *InMemoryBackend) RunJanitor(ctx context.Context, interval time.Duration)

RunJanitor sweeps lifecycle rules every interval until ctx ends.

func (*InMemoryBackend) RunLifecycle

func (b *InMemoryBackend) RunLifecycle()

RunLifecycle applies every bucket's lifecycle rules once and purges expired soft-deleted objects.

func (*InMemoryBackend) SetACL

func (b *InMemoryBackend) SetACL(t aclTarget, e ACLEntry) (ACLEntry, int64, error)

SetACL inserts the entry or changes the role of the existing entry for the same entity.

func (*InMemoryBackend) SetClock

func (b *InMemoryBackend) SetClock(fn func() time.Time)

SetClock replaces the time source used for timestamps, retention, lifecycle and signed-URL expiry.

func (*InMemoryBackend) SetIAMPolicy

func (b *InMemoryBackend) SetIAMPolicy(name string, pol IAMPolicy) (IAMPolicy, error)

SetIAMPolicy replaces the bucket IAM policy; a non-empty etag must match.

func (*InMemoryBackend) SetKMSChecker

func (b *InMemoryBackend) SetKMSChecker(c cmek.Checker)

SetKMSChecker validates Cloud KMS keys on buckets and objects; nil disables validation.

func (*InMemoryBackend) SetKeyResolver

func (b *InMemoryBackend) SetKeyResolver(fn KeyResolver)

SetKeyResolver wires the service-account key lookup used to verify GOOG4-RSA-SHA256 and V2 signatures.

func (*InMemoryBackend) SetNotifier

func (b *InMemoryBackend) SetNotifier(n Notifier)

SetNotifier wires the Pub/Sub publisher that delivers notificationConfigs.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state. In-flight resumable sessions are not persisted.

func (*InMemoryBackend) StartUpload

func (b *InMemoryBackend) StartUpload(bucket, name string, meta Patch, pre Preconds) (string, error)

StartUpload opens a resumable upload session and returns its id.

func (*InMemoryBackend) UpdateBucket

func (b *InMemoryBackend) UpdateBucket(name string, p Patch, replace bool, pre Preconds) (*Bucket, error)

UpdateBucket applies a PATCH (replace=false) or PUT (replace=true) body.

func (*InMemoryBackend) UpdateHMACKey

func (b *InMemoryBackend) UpdateHMACKey(project, id, state string) (*HMACKey, error)

UpdateHMACKey switches a key between ACTIVE and INACTIVE.

func (*InMemoryBackend) UpdateObject

func (b *InMemoryBackend) UpdateObject(
	bucket, name string, gen int64, p Patch, replace bool, pre Preconds,
) (*Object, error)

UpdateObject applies a PATCH (replace=false) or PUT (replace=true) body.

func (*InMemoryBackend) UploadPart

func (b *InMemoryBackend) UploadPart(bucket, name, id string, number int, data []byte, keySHA string) (string, error)

UploadPart stores one part and returns its ETag; keySHA must equal the key the upload was initiated with.

type KeyResolver

type KeyResolver func(email string) []*rsa.PublicKey

KeyResolver returns the RSA public keys of a service account (by email) for signed-URL verification.

type ListOptions

type ListOptions struct {
	Prefix                   string
	Delimiter                string
	StartOffset              string
	EndOffset                string
	PageToken                string
	MatchGlob                string
	MaxResults               int
	Versions                 bool
	SoftDeleted              bool
	IncludeTrailingDelimiter bool
	IncludeFolders           bool
	Lookahead                bool
}

ListOptions are the object list parameters.

type ListResult

type ListResult struct {
	Next     string
	Items    []*Object
	Prefixes []string
}

ListResult is one page of objects and collapsed prefixes.

type Notification

type Notification struct {
	CustomAttributes map[string]string `json:"customAttributes,omitempty"`
	ID               string            `json:"id"`
	Topic            string            `json:"topic"`
	ObjectNamePrefix string            `json:"objectNamePrefix,omitempty"`
	PayloadFormat    string            `json:"payloadFormat"`
	EventTypes       []string          `json:"eventTypes,omitempty"`
}

Notification is a bucket notificationConfig (storage#notification).

type Notifier

type Notifier interface {
	TopicExists(topic string) bool
	Publish(topic string, data []byte, attrs map[string]string) error
}

Notifier publishes bucket notifications to Pub/Sub topics ("projects/P/topics/T"); injected at wiring.

type Object

type Object struct {
	Created        time.Time `json:"created"`
	Updated        time.Time `json:"updated"`
	Deleted        time.Time `json:"deleted"`
	CustomTime     time.Time `json:"customTime"`
	HoldReleased   time.Time `json:"holdReleased"`
	SoftDeleteTime time.Time `json:"softDeleteTime"`
	HardDeleteTime time.Time `json:"hardDeleteTime"`
	ClassUpdated   time.Time `json:"classUpdated"`
	Accessed       time.Time `json:"accessed,omitzero"`

	Metadata           map[string]string `json:"metadata,omitempty"`
	ContentLanguage    string            `json:"contentLanguage,omitempty"`
	CRC32C             string            `json:"crc32c"`
	ContentType        string            `json:"contentType"`
	ContentEncoding    string            `json:"contentEncoding,omitempty"`
	ContentDisposition string            `json:"contentDisposition,omitempty"`
	Bucket             string            `json:"bucket"`
	CacheControl       string            `json:"cacheControl,omitempty"`
	StorageClass       string            `json:"storageClass"`
	MD5                string            `json:"md5,omitempty"`
	PartsETag          string            `json:"partsEtag,omitempty"`
	Name               string            `json:"name"`
	CustomerKeySHA256  string            `json:"customerKeySha256,omitempty"`
	KMSKeyName         string            `json:"kmsKeyName,omitempty"`
	ObjectRetention    *ObjectRetention  `json:"objectRetention,omitempty"`
	Data               []byte            `json:"data"`
	ACL                []ACLEntry        `json:"acl,omitempty"`
	Generation         int64             `json:"generation"`
	Metageneration     int64             `json:"metageneration"`
	ComponentCount     int64             `json:"componentCount,omitempty"`
	TemporaryHold      bool              `json:"temporaryHold,omitempty"`
	EventBasedHold     bool              `json:"eventBasedHold,omitempty"`
	// contains filtered or unexported fields
}

Object is one stored object version. A version whose Deleted time is set is noncurrent; the live version, if any, is always last in its slice.

func (*Object) Size

func (o *Object) Size() int64

Size returns the object size in bytes.

type ObjectEvent

type ObjectEvent struct {
	Time   time.Time
	Object *Object
	Type   ObjectEventType
	// OverwroteGen is the replaced generation on a finalize; OverwrittenByGen the replacing one on delete/archive.
	OverwroteGen     int64
	OverwrittenByGen int64
}

ObjectEvent describes one object change; Object is a private copy.

func (ObjectEvent) Data

func (e ObjectEvent) Data() jsontext.Value

Data is the event payload: the object resource, as the Cloud Storage JSON API renders it.

type ObjectEventType

type ObjectEventType string

ObjectEventType names a change to an object, matching the suffix of the google.cloud.storage.object.v1 event types.

const (
	// ObjectFinalized is a new object (or generation) becoming readable.
	ObjectFinalized ObjectEventType = "finalized"
	// ObjectDeleted is an object generation being permanently removed.
	ObjectDeleted ObjectEventType = "deleted"
	// ObjectArchived is the live generation of a versioned bucket becoming noncurrent.
	ObjectArchived ObjectEventType = "archived"
	// ObjectMetadataUpdated is a metadata change to an existing generation.
	ObjectMetadataUpdated ObjectEventType = "metadataUpdated"
)

type ObjectObserver

type ObjectObserver func(ObjectEvent)

ObjectObserver is called after an object change is committed, outside the backend lock.

type ObjectRetention

type ObjectRetention struct {
	RetainUntil time.Time `json:"retainUntil"`
	Mode        string    `json:"mode"`
}

ObjectRetention is the retention lock of one object.

type PartRef

type PartRef struct {
	ETag   string
	Number int
}

PartRef names one part in a complete request.

type Patch

type Patch map[string]jsontext.Value

Patch is a decoded JSON request body, keyed by field name. A null value clears the field, as in a JSON merge patch.

type Preconds

type Preconds struct {
	GenMatch     *int64
	GenNotMatch  *int64
	MetaMatch    *int64
	MetaNotMatch *int64
}

Preconds are the ifGeneration*/ifMetageneration* request conditions.

type Provider

type Provider struct{}

Provider implements service.Provider for Google Cloud Storage. Like the Azure services it runs on its own listener (see Handler.StartWorker) and never matches on the shared AWS router.

func (*Provider) Init

Init creates the backend and handler; the port is bound in StartWorker.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type Settings

type Settings struct {
	RequireAuth bool `` //nolint:lll // config struct tags are intentionally verbose
	/* 237-byte string literal not displayed */
	Port int `` //nolint:lll // config struct tags are intentionally verbose
	/* 192-byte string literal not displayed */
}

Settings holds service-level configuration, embedded in the root CLI command as CLI.GCPStorage.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the settings used when no ConfigProvider is available.

type UploadProgress

type UploadProgress struct {
	Object   *Object
	Received int64
}

UploadProgress reports a session's state after an append.

Jump to

Keyboard shortcuts

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