storage

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MaxS3MultipartPartNumber int32 = 10_000

MaxS3MultipartPartNumber is the highest part number accepted by S3 multipart uploads.

View Source
const MultipartCompletionMarkerMetadataKey = "syfon-multipart-id"

Variables

View Source
var ErrMultipartCompletionIndeterminate = errors.New("multipart completion outcome is indeterminate")

Functions

func ContentDispositionAttachment

func ContentDispositionAttachment(name string) string

func DownloadFilename

func DownloadFilename(name string) string

func MultipartPartObjectKey

func MultipartPartObjectKey(key string, uploadID UploadID, partNumber int32) string

func MultipartUploadPrefix added in v0.4.2

func MultipartUploadPrefix(key string, uploadID UploadID) (string, error)

Types

type AbortMultipartRequest added in v0.4.2

type AbortMultipartRequest struct {
	Target       Target
	UploadID     UploadID
	CompletionID string
}

type BeginMultipartRequest added in v0.4.2

type BeginMultipartRequest struct {
	Target       Target
	CompletionID string
}

type ByteRange

type ByteRange struct {
	Start int64
	End   int64
}

type CompleteMultipartRequest

type CompleteMultipartRequest struct {
	Target       Target
	UploadID     UploadID
	CompletionID string
	Parts        []CompletedPart
}

type CompletedPart

type CompletedPart struct {
	PartNumber int32
	ETag       string
}

type CredentialLookup

type CredentialLookup interface {
	GetS3Credential(ctx context.Context, bucket string) (*buckets.Credential, error)
}

CredentialLookup reads one configured bucket credential by identifier or physical bucket name.

type DeleteTarget

type DeleteTarget struct {
	Location string
}

type Deleter added in v0.4.2

type Deleter interface {
	Delete(context.Context, ProviderBinding, []PhysicalTarget) error
}

type ErrorKind

type ErrorKind string
const (
	ErrorInvalid     ErrorKind = "invalid"
	ErrorNotFound    ErrorKind = "not_found"
	ErrorForbidden   ErrorKind = "forbidden"
	ErrorUnavailable ErrorKind = "unavailable"
	ErrorIncomplete  ErrorKind = "incomplete"
	ErrorUnsupported ErrorKind = "unsupported"
	ErrorProvider    ErrorKind = "provider"
)

type Invalidator added in v0.4.2

type Invalidator interface {
	InvalidateBucket(string)
}

type InventoryRequest

type InventoryRequest struct {
	Target      Target
	Prefix      string
	IncludeHead bool
	ExactPrefix bool
	// MaxKeys sizes each provider page; MaxResults bounds the whole listing.
	MaxKeys    int32
	MaxResults int32
}

type InventoryResult

type InventoryResult struct {
	Items    []ObjectMetadata
	Complete bool
}

type Inventoryer added in v0.4.2

type Inventoryer interface {
	Inventory(context.Context, ProviderBinding, InventoryRequest) (InventoryResult, error)
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(credentials CredentialLookup, registrations ...Registration) (*Manager, error)

func (*Manager) AbortMultipart added in v0.4.2

func (m *Manager) AbortMultipart(ctx context.Context, request AbortMultipartRequest) error

AbortMultipart asks a provider to discard an in-progress multipart upload. Providers that cannot expose an abort API are reported as unsupported and the durable session remains available for a later retry.

func (*Manager) BeginMultipart

func (m *Manager) BeginMultipart(ctx context.Context, request BeginMultipartRequest) (UploadID, error)

func (*Manager) Close added in v0.4.2

func (m *Manager) Close() error

Close releases resources owned by the manager. Registrations are closed in construction order and repeated calls return the same aggregate result.

func (*Manager) CompleteMultipart

func (m *Manager) CompleteMultipart(ctx context.Context, request CompleteMultipartRequest) error

func (*Manager) DeleteExact

func (m *Manager) DeleteExact(ctx context.Context, targets []DeleteTarget) error

func (*Manager) InvalidateBucket

func (m *Manager) InvalidateBucket(bucket string)

func (*Manager) Inventory

func (m *Manager) Inventory(ctx context.Context, request InventoryRequest) (InventoryResult, error)

func (*Manager) Probe

func (m *Manager) Probe(ctx context.Context, targets []ProbeTarget) []ProbeResult

func (*Manager) Sign added in v0.4.2

func (m *Manager) Sign(ctx context.Context, request SignRequest) (SignedAccess, error)

Sign resolves one credential binding and passes it to the provider.

func (*Manager) SignMultipartPart added in v0.4.2

func (m *Manager) SignMultipartPart(ctx context.Context, request MultipartPartRequest) (SignedAccess, error)

type MultipartAborter added in v0.4.2

type MultipartAborter interface {
	AbortMultipart(context.Context, ProviderBinding, AbortMultipartRequest) error
}

MultipartAborter is optional so existing provider implementations remain source-compatible. Production providers implement exact, provider-native cleanup semantics where the backend supports them.

type MultipartPartRequest

type MultipartPartRequest struct {
	Target     Target
	UploadID   UploadID
	PartNumber int32
	ExpiresIn  time.Duration
}

type ObjectMetadata

type ObjectMetadata struct {
	Provider     string
	Bucket       string
	Key          string
	Path         string
	SizeBytes    int64
	MetaSHA256   string
	ETag         string
	LastModified time.Time
}

type OperationError

type OperationError struct {
	Kind       ErrorKind
	Provider   string
	Capability string
	Cause      error
}

func (*OperationError) Error

func (e *OperationError) Error() string

func (*OperationError) ErrorCategory added in v0.4.1

func (e *OperationError) ErrorCategory() errorapi.ErrorCategory

func (*OperationError) ErrorCode added in v0.4.1

func (e *OperationError) ErrorCode() errorapi.ErrorCode

func (*OperationError) Is added in v0.4.1

func (e *OperationError) Is(target error) bool

func (*OperationError) PublicMessage added in v0.4.1

func (e *OperationError) PublicMessage() string

func (*OperationError) Unwrap

func (e *OperationError) Unwrap() error

type PhysicalTarget

type PhysicalTarget struct {
	Provider       string
	LookupKey      string
	PhysicalBucket string
	Key            string
	Path           string
}

type ProbeResult

type ProbeResult struct {
	ID       string
	Target   Target
	Metadata ObjectMetadata
	Err      error
}

type ProbeTarget

type ProbeTarget struct {
	ID     string
	Target Target
}

type Prober added in v0.4.2

type Prober interface {
	Probe(context.Context, ProviderBinding, []ProbeTarget) []ProbeResult
}

type ProviderBinding added in v0.4.2

type ProviderBinding struct {
	Provider       string
	LookupKey      string
	PhysicalBucket string
	Credential     *buckets.Credential
}

type Registration

type Registration struct {
	// contains filtered or unexported fields
}

func NewRegistration

func NewRegistration(provider string, backend Provider) Registration

type SignRequest added in v0.4.2

type SignRequest struct {
	Target           Target
	Method           string
	ExpiresIn        time.Duration
	DownloadFilename string
	Range            *ByteRange
}

type SignedAccess added in v0.4.2

type SignedAccess struct {
	Location string
}

type Target added in v0.4.2

type Target struct {
	Provider         string
	LookupKey        string
	PhysicalBucket   string
	Key              string
	Path             string
	OriginalURL      string
	CanonicalURL     string
	LookupCandidates []string
}

type UploadID

type UploadID string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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