storage

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 UploadSignedMultipartPart

func UploadSignedMultipartPart(ctx context.Context, signedURL string, content []byte) (string, error)

Types

type Access

type Access struct {
	Location string
}

type AccessOptions

type AccessOptions struct {
	ExpiresIn        time.Duration
	Method           string
	DownloadFilename string
}

type AccessRequest

type AccessRequest struct {
	Target  AccessTarget
	Options AccessOptions
	Range   *ByteRange
}

type AccessTarget

type AccessTarget struct {
	AccessID string
	Location string
}

type ByteRange

type ByteRange struct {
	Start int64
	End   int64
}

type CompleteMultipartRequest

type CompleteMultipartRequest struct {
	Target   ObjectTarget
	UploadID UploadID
	Parts    []CompletedPart
}

type CompletedPart

type CompletedPart struct {
	PartNumber int32
	ETag       string
}

func NormalizedMultipartParts

func NormalizedMultipartParts(parts []CompletedPart) []CompletedPart

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 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 InventoryRequest

type InventoryRequest struct {
	Target      PrefixTarget
	IncludeHead bool
	ExactPrefix bool
	MaxKeys     int32
}

type InventoryResult

type InventoryResult struct {
	Items    []ObjectMetadata
	Complete bool
}

type Manager

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

func NewManager

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

func (*Manager) Access

func (m *Manager) Access(ctx context.Context, request AccessRequest) (Access, error)

func (*Manager) AccessMultipartPart

func (m *Manager) AccessMultipartPart(ctx context.Context, request MultipartPartRequest) (Access, error)

func (*Manager) BeginMultipart

func (m *Manager) BeginMultipart(ctx context.Context, target ObjectTarget) (UploadID, error)

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

type MultipartPartRequest

type MultipartPartRequest struct {
	Target     ObjectTarget
	UploadID   UploadID
	PartNumber int32
}

type ObjectMetadata

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

type ObjectTarget

type ObjectTarget struct {
	Bucket string
	Key    string
}

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
	Bucket   string
	Key      string
	Path     string
}

type PrefixTarget

type PrefixTarget struct {
	Bucket string
	Prefix string
}

type ProbeResult

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

type ProbeTarget

type ProbeTarget struct {
	ID     string
	Target ObjectTarget
}

type Registration

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

func NewRegistration

func NewRegistration(provider string, backend completeBackend) Registration

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