s3blob

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package s3blob provides a blob.Bucket S3 driver implementation.

NB! To minimize breaking changes with older PocketBase releases, the driver is based of the previously used gocloud.dev/blob/s3blob, hence many of the below doc comments, struct options and interface implementations are the same.

The blob abstraction supports all UTF-8 strings; to make this work with services lacking full UTF-8 support, strings must be escaped (during writes) and unescaped (during reads). The following escapes are performed for s3blob:

  • Blob keys: ASCII characters 0-31 are escaped to "__0x<hex>__". Additionally, the "/" in "../" is escaped in the same way.
  • Metadata keys: Escaped using URL encoding, then additionally "@:=" are escaped using "__0x<hex>__". These characters were determined by experimentation.
  • Metadata values: Escaped using URL encoding.

Example:

drv, _ := s3blob.New(&s3.S3{
	Bucket:    "bucketName",
	Region:    "region",
	Endpoint:  "endpoint",
	AccessKey: "accessKey",
	SecretKey: "secretKey",
})
bucket := blob.NewBucket(drv)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(s3Client *s3.S3) (blob.Driver, error)

New creates a new instance of the S3 driver backed by the the internal S3 client.

Types

This section is empty.

Directories

Path Synopsis
s3
Package s3 implements a lightweight client for interacting with the REST APIs of any S3 compatible service.
Package s3 implements a lightweight client for interacting with the REST APIs of any S3 compatible service.
tests
Package tests contains various tests helpers and utilities to assist with the S3 client testing.
Package tests contains various tests helpers and utilities to assist with the S3 client testing.

Jump to

Keyboard shortcuts

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