Documentation
¶
Index ¶
- type AccessFailure
- type AccessLookupRequest
- type AccessLookupResult
- type AccessRequest
- type AccessScope
- type AccountingMode
- type BulkAccessLookupResult
- type ByteRange
- type CanonicalStorageTarget
- type CanonicalStorageTargetRequest
- type CompletedPart
- type CredentialReader
- type Dependencies
- type DownloadRequest
- type DownloadResult
- type EventRecorder
- type MultipartAbortStore
- type MultipartAborter
- type MultipartActivityStore
- type MultipartAuthorization
- type MultipartCompletionPartsClaimer
- type MultipartCompletionReceipt
- type MultipartCompletionReceiptStore
- type MultipartInitRequest
- type MultipartInitResult
- type MultipartOperation
- type MultipartReconcilerStore
- type MultipartSession
- type MultipartSessionStore
- type MultipartState
- type ObjectPort
- type ResolvedAccess
- type ScopeReader
- type Service
- func (s *Service) AbortMultipart(ctx context.Context, uploadID string) error
- func (s *Service) BeginMultipart(ctx context.Context, req MultipartInitRequest) (MultipartInitResult, error)
- func (s *Service) CompleteMultipart(ctx context.Context, uploadID string, parts []CompletedPart) (string, error)
- func (s *Service) Download(ctx context.Context, req DownloadRequest) (DownloadResult, error)
- func (s *Service) IssueAccess(ctx context.Context, request AccessLookupRequest) (AccessLookupResult, error)
- func (s *Service) IssueAccessBulk(ctx context.Context, requests []AccessLookupRequest) BulkAccessLookupResult
- func (s *Service) ReconcileMultipartSessions(ctx context.Context, inactiveTimeout, completedRetention time.Duration, ...) error
- func (s *Service) RecordAccessIssued(ctx context.Context, request AccessRequest) error
- func (s *Service) ResolveCanonicalStorageTarget(ctx context.Context, req CanonicalStorageTargetRequest) (CanonicalStorageTarget, error)
- func (s *Service) ResolveScopedUploadTarget(ctx context.Context, organization, project, key string) (CanonicalStorageTarget, error)
- func (s *Service) SignMultipartPart(ctx context.Context, uploadID string, partNumber int32) (string, error)
- func (s *Service) UploadBulk(ctx context.Context, requests []UploadRequest) []UploadResult
- func (s *Service) UploadURL(ctx context.Context, req UploadRequest) (UploadResult, error)
- type StoragePort
- type UploadRequest
- type UploadResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessFailure ¶ added in v0.4.2
type AccessLookupRequest ¶ added in v0.4.2
type AccessLookupResult ¶
type AccessRequest ¶
type AccessRequest struct {
Object *drs.DrsObject
Target storage.Target
// Scope is an operation-selected attribution scope. It is optional because
// most transfer paths do not select a project independently of the object.
// RecordAccessIssued validates it against the object's canonical resources
// before using it for event attribution.
Scope *AccessScope
AccessID string
Direction string
StorageURL string
RangeStart *int64
RangeEnd *int64
BytesRequested int64
ClientName string
ClientVersion string
}
AccessRequest is the transfer-domain request for one access-issued event. Object is already authorized and hydrated by the caller; transfers does not perform another object lookup.
type AccessScope ¶
AccessScope identifies the organization/project scope selected by an already-authorized transfer operation.
type AccountingMode ¶ added in v0.4.2
type AccountingMode string
const ( AccountingNone AccountingMode = "none" AccountingDownloadBeforeEvent AccountingMode = "download_before_event" AccountingEventOnly AccountingMode = "event_only" )
type BulkAccessLookupResult ¶
type BulkAccessLookupResult struct {
Requested int
Resolved []ResolvedAccess
Failures []AccessFailure
}
type ByteRange ¶ added in v0.4.2
ByteRange is the inclusive byte range requested by a transfer operation. Storage providers receive the translated storage.ByteRange only inside the transfer service boundary.
type CanonicalStorageTarget ¶
CanonicalStorageTarget is a provider-neutral target. URL is the canonical s3:// representation for bucket/key targets; non-S3 locations are returned with only URL populated by ResolveCanonicalStorageTarget.
type CanonicalStorageTargetRequest ¶
type CanonicalStorageTargetRequest struct {
Object *drs.DrsObject
AccessURL string
Bucket string
Key string
PreferChecksum bool
}
CanonicalStorageTargetRequest describes the object-backed target selection used by upload signing and by repairable logical download URLs.
type CompletedPart ¶ added in v0.4.2
CompletedPart carries multipart completion metadata across the transfer boundary. Provider-specific part values are created only by Service.
type CredentialReader ¶
type CredentialReader interface {
ListS3Credentials(context.Context) ([]buckets.Credential, error)
}
type Dependencies ¶
type Dependencies struct {
Objects ObjectPort
Storage StoragePort
FileCounters usage.FileCounterRecorder
Scopes ScopeReader
Credentials CredentialReader
Events EventRecorder
MultipartSessions MultipartSessionStore
Now func() time.Time
DefaultSigningExpiry time.Duration
}
type DownloadRequest ¶ added in v0.4.2
type DownloadResult ¶ added in v0.4.2
type EventRecorder ¶
type MultipartAbortStore ¶ added in v0.4.2
type MultipartAborter ¶ added in v0.4.2
type MultipartAborter interface {
AbortMultipart(context.Context, storage.AbortMultipartRequest) error
}
type MultipartActivityStore ¶ added in v0.4.2
type MultipartAuthorization ¶ added in v0.4.2
type MultipartAuthorization struct {
Resources []string `json:"resources,omitempty"`
Methods []string `json:"methods,omitempty"`
Scope *AccessScope `json:"scope,omitempty"`
}
type MultipartCompletionPartsClaimer ¶ added in v0.4.2
type MultipartCompletionPartsClaimer interface {
ClaimMultipartCompletionWithParts(context.Context, string, string, string, []CompletedPart, time.Time, time.Time) (MultipartSession, bool, error)
}
Optional multipart capabilities preserve compatibility for callers with lightweight session stores while the durable store can persist operation intent and completion inputs atomically.
type MultipartCompletionReceipt ¶ added in v0.4.2
type MultipartCompletionReceipt struct {
UploadID string
Authorization MultipartAuthorization
PartsFingerprint string
CompletedLocation string
}
type MultipartCompletionReceiptStore ¶ added in v0.4.2
type MultipartCompletionReceiptStore interface {
GetMultipartCompletionReceipt(context.Context, string) (MultipartCompletionReceipt, error)
}
type MultipartInitRequest ¶ added in v0.4.2
type MultipartInitResult ¶ added in v0.4.2
type MultipartOperation ¶ added in v0.4.2
type MultipartOperation string
const ( MultipartOperationNone MultipartOperation = "" MultipartOperationComplete MultipartOperation = "complete" MultipartOperationAbort MultipartOperation = "abort" )
type MultipartReconcilerStore ¶ added in v0.4.2
type MultipartSession ¶ added in v0.4.2
type MultipartSession struct {
UploadID string `json:"upload_id"`
CompletionID string `json:"completion_id"`
Target storage.Target `json:"target"`
Authorization MultipartAuthorization `json:"authorization"`
State MultipartState `json:"state"`
CompletionToken string `json:"completion_token,omitempty"`
PartsFingerprint string `json:"parts_fingerprint,omitempty"`
Operation MultipartOperation `json:"operation,omitempty"`
CompletionParts []CompletedPart `json:"completion_parts,omitempty"`
CompletedLocation string `json:"completed_location,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type MultipartSessionStore ¶ added in v0.4.2
type MultipartSessionStore interface {
SaveMultipartSession(context.Context, MultipartSession) error
GetMultipartSession(context.Context, string) (MultipartSession, error)
ClaimMultipartCompletion(context.Context, string, string, string, time.Time, time.Time) (MultipartSession, bool, error)
ReleaseMultipartCompletion(context.Context, string, string, time.Time) error
FinishMultipartCompletion(context.Context, string, string, string, time.Time) (bool, error)
}
type MultipartState ¶ added in v0.4.2
type MultipartState string
const ( MultipartStateActive MultipartState = "active" MultipartStateCompleting MultipartState = "completing" MultipartStateCompleted MultipartState = "completed" )
type ObjectPort ¶ added in v0.4.2
type ObjectPort interface {
GetObject(context.Context, string, string) (*drs.DrsObject, error)
GetObjectsByChecksums(context.Context, []string, string) (map[string][]drs.DrsObject, error)
}
ObjectPort is the catalog capability required by transfer operations.
type ResolvedAccess ¶
type ScopeReader ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(deps Dependencies) *Service
func (*Service) AbortMultipart ¶ added in v0.4.2
AbortMultipart is an additive, idempotent operation. Authorization is evaluated before a durable abort lease is claimed, while the provider call itself runs under the claimed session state.
func (*Service) BeginMultipart ¶ added in v0.4.2
func (s *Service) BeginMultipart(ctx context.Context, req MultipartInitRequest) (MultipartInitResult, error)
func (*Service) CompleteMultipart ¶ added in v0.4.2
func (*Service) Download ¶ added in v0.4.2
func (s *Service) Download(ctx context.Context, req DownloadRequest) (DownloadResult, error)
func (*Service) IssueAccess ¶ added in v0.4.2
func (s *Service) IssueAccess(ctx context.Context, request AccessLookupRequest) (AccessLookupResult, error)
func (*Service) IssueAccessBulk ¶ added in v0.4.2
func (s *Service) IssueAccessBulk(ctx context.Context, requests []AccessLookupRequest) BulkAccessLookupResult
func (*Service) ReconcileMultipartSessions ¶ added in v0.4.2
func (*Service) RecordAccessIssued ¶
func (s *Service) RecordAccessIssued(ctx context.Context, request AccessRequest) error
RecordAccessIssued assembles one usage event and sends it to the narrow recorder. A nil object remains a no-op for new-object upload paths.
func (*Service) ResolveCanonicalStorageTarget ¶
func (s *Service) ResolveCanonicalStorageTarget(ctx context.Context, req CanonicalStorageTargetRequest) (CanonicalStorageTarget, error)
ResolveCanonicalStorageTarget selects the physical target for an object. Scoped objects use the last non-empty bucket from their deterministic scope order and compose nested path prefixes. Unscoped non-S3 URLs pass through.
func (*Service) ResolveScopedUploadTarget ¶
func (s *Service) ResolveScopedUploadTarget(ctx context.Context, organization, project, key string) (CanonicalStorageTarget, error)
ResolveScopedUploadTarget resolves an upload resource into its physical bucket/key. Organization and project scopes compose in lookup order.
func (*Service) SignMultipartPart ¶
func (*Service) UploadBulk ¶ added in v0.4.2
func (s *Service) UploadBulk(ctx context.Context, requests []UploadRequest) []UploadResult
func (*Service) UploadURL ¶ added in v0.4.2
func (s *Service) UploadURL(ctx context.Context, req UploadRequest) (UploadResult, error)
type StoragePort ¶ added in v0.4.2
type StoragePort interface {
Sign(context.Context, storage.SignRequest) (storage.SignedAccess, error)
BeginMultipart(context.Context, storage.BeginMultipartRequest) (storage.UploadID, error)
SignMultipartPart(context.Context, storage.MultipartPartRequest) (storage.SignedAccess, error)
CompleteMultipart(context.Context, storage.CompleteMultipartRequest) error
}
StoragePort is the provider-neutral storage capability required by transfer operations. Target selection and credential binding stay below this boundary.
type UploadRequest ¶ added in v0.4.2
type UploadRequest struct {
ObjectID string
Key string
Scope *AccessScope
ExpiresIn time.Duration
}