Documentation
¶
Overview ¶
Package blobstorage provides a factory for creating blob storage buckets with provider-specific initialization.
The factory handles provider-specific configuration such as signed URL support for GCS, then returns standard gocloud blob.Bucket instances.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBucketURLRequired is returned when bucket URL is not provided. ErrBucketURLRequired = errors.New("bucket URL is required") // ErrGCSServiceAccountRequired is returned when GCS service account is not provided for gs:// URLs. // See scripts/create-dev-service-account.sh for details of what permissions the SA needs. ErrGCSServiceAccountRequired = errors.New("GCS service account is required for gs:// bucket URLs") )
Functions ¶
This section is empty.
Types ¶
type BucketFactory ¶
type BucketFactory struct {
// contains filtered or unexported fields
}
BucketFactory creates blob storage buckets with provider-specific initialization.
func NewBucketFactory ¶
func NewBucketFactory(ctx context.Context, config Config) (*BucketFactory, error)
NewBucketFactory creates a new bucket factory with the given configuration. For GCS buckets, a service account is required for signed URL support.
func (*BucketFactory) GetBucketURL ¶
func (f *BucketFactory) GetBucketURL() string
GetBucketURL returns the configured bucket URL.
func (*BucketFactory) OpenBucket ¶
OpenBucket opens a bucket with provider-specific configuration. Returns a standard gocloud blob.Bucket with all initialization done.
type Config ¶
type Config struct {
// BucketURL is the full bucket URL (e.g., "gs://bucket-name/", "s3://bucket-name/")
BucketURL string
// GCS-specific configuration for signed URL support
GCSServiceAccount string // Service account email (required for gs:// URLs)
}
Config holds configuration for creating blob storage buckets.