Documentation
¶
Index ¶
- type CredentialReader
- type DeletePort
- type DeleteResult
- type Dependencies
- type Error
- type ErrorKind
- type InspectRequest
- type InspectionMode
- type InspectionOptions
- type InspectionResult
- type Inspector
- func (s *Inspector) AuditProjectRecords(ctx context.Context, organization, project, requestPrefix string) ([]ProjectRecordAudit, error)
- func (s *Inspector) InspectProjectStorage(ctx context.Context, organization, project string, options InspectionOptions) (*InspectionResult, error)
- func (s *Inspector) ListObjects(ctx context.Context, organization, project string, includeHead bool) ([]StorageObject, error)
- func (s *Inspector) ProbeObject(ctx context.Context, request InspectRequest) (*ObjectMetadata, error)
- func (s *Inspector) ProbeObjects(ctx context.Context, requests []InspectRequest) []ProbeResult
- func (s *Inspector) ResolvePathPrefix(ctx context.Context, organization, project, requestPrefix string) (string, error)
- func (s *Inspector) ValidateInventoryObjects(ctx context.Context, requests []ListValidationRequest) []ListValidationResult
- type InventoryOptions
- type InventoryPort
- type ListValidationRequest
- type ListValidationResult
- type ObjectMetadata
- type ObjectScopeDeleter
- type PhysicalScopeReader
- type ProbePort
- type ProbeResult
- type ProbeStatus
- type ProjectAccessMethod
- type ProjectCleanup
- type ProjectCleanupResult
- type ProjectRecordAudit
- type ScopeCatalog
- type ScopeReader
- type Service
- type StorageObject
- type Summary
- type ValidationStatus
- type VisibilityReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CredentialReader ¶
type DeletePort ¶
type DeletePort interface {
DeleteExact(context.Context, []storage.DeleteTarget) error
}
type DeleteResult ¶
type Dependencies ¶
type Dependencies struct {
Scopes ScopeReader
Credentials CredentialReader
Visibility VisibilityReader
Inventory InventoryPort
Probe ProbePort
Delete DeletePort
Physical PhysicalScopeReader
CleanupObjects ObjectScopeDeleter
CleanupScopes ScopeCatalog
}
type Error ¶
Error is a typed maintenance error. HTTP adapters map its Kind to status codes; domain callers can use errors.As without importing HTTP packages.
func (*Error) ErrorCategory ¶ added in v0.4.1
func (e *Error) ErrorCategory() errorapi.ErrorCategory
func (*Error) PublicMessage ¶ added in v0.4.1
type ErrorKind ¶
type ErrorKind string
const ( ErrorInvalidInput ErrorKind = "invalid_input" ErrorScopeNotFound ErrorKind = "scope_not_found" ErrorCredentialMissing ErrorKind = "credential_missing" ErrorPermissionDenied ErrorKind = "permission_denied" ErrorObjectNotFound ErrorKind = "object_not_found" ErrorListingIncomplete ErrorKind = "listing_incomplete" ErrorUnsupported ErrorKind = "unsupported" )
type InspectRequest ¶
type InspectionMode ¶
type InspectionMode string
InspectionMode controls the amount of inventory returned by InspectProjectStorage.
const ( ModeItems InspectionMode = "items" ModeExists InspectionMode = "exists" ModeSummary InspectionMode = "summary" )
type InspectionOptions ¶
type InspectionOptions struct {
Mode InspectionMode
IncludeHead bool
PathPrefix string
}
type InspectionResult ¶
type InspectionResult struct {
Summary Summary
Items []StorageObject
}
type Inspector ¶
type Inspector struct {
// contains filtered or unexported fields
}
func (*Inspector) AuditProjectRecords ¶
func (s *Inspector) AuditProjectRecords(ctx context.Context, organization, project, requestPrefix string) ([]ProjectRecordAudit, error)
AuditProjectRecords projects physical records for the project-record inspection route. Unlike prepared inventory reads, it intentionally keeps same-checksum physical duplicates visible and only emits records carrying a primary SHA-256 checksum.
func (*Inspector) InspectProjectStorage ¶
func (s *Inspector) InspectProjectStorage(ctx context.Context, organization, project string, options InspectionOptions) (*InspectionResult, error)
InspectProjectStorage inventories the S3 target selected by the project's configured scope.
func (*Inspector) ListObjects ¶
func (*Inspector) ProbeObject ¶
func (s *Inspector) ProbeObject(ctx context.Context, request InspectRequest) (*ObjectMetadata, error)
func (*Inspector) ProbeObjects ¶
func (s *Inspector) ProbeObjects(ctx context.Context, requests []InspectRequest) []ProbeResult
func (*Inspector) ResolvePathPrefix ¶
func (*Inspector) ValidateInventoryObjects ¶
func (s *Inspector) ValidateInventoryObjects(ctx context.Context, requests []ListValidationRequest) []ListValidationResult
ValidateInventoryObjects compares requested physical S3 locations with inventory evidence. Exact targets are deduplicated, dense sibling keys are coalesced at the historical threshold, and output is always restored to input order including duplicate requests.
type InventoryOptions ¶
type InventoryPort ¶
type InventoryPort interface {
Inventory(context.Context, storage.InventoryRequest) (storage.InventoryResult, error)
}
type ListValidationRequest ¶
type ListValidationResult ¶
type ListValidationResult struct {
ID string
ObjectURL string
Provider string
Bucket string
Key string
Path string
Exists bool
Status ProbeStatus
Error string
ErrorKind string
SizeBytes *int64
ETag string
LastModTime time.Time
ValidationStatus ValidationStatus
SizeMatch *bool
NameMatch *bool
ValidationMismatches []string
}
type ObjectMetadata ¶
type ObjectScopeDeleter ¶
type PhysicalScopeReader ¶
type ProbePort ¶
type ProbePort interface {
Probe(context.Context, []storage.ProbeTarget) []storage.ProbeResult
}
type ProbeResult ¶
type ProbeResult struct {
ID string
ObjectURL string
Provider string
Bucket string
Key string
Path string
Exists bool
Status ProbeStatus
Error string
ErrorKind string
SizeBytes *int64
MetaSHA256 string
ETag string
LastModTime time.Time
ValidationStatus ValidationStatus
SizeMatch *bool
SHA256Match *bool
ValidationMismatches []string
}
type ProbeStatus ¶
type ProbeStatus string
const ( ProbePresent ProbeStatus = "present" ProbeNotFound ProbeStatus = "not_found" ProbeForbidden ProbeStatus = "forbidden" ProbeInvalid ProbeStatus = "invalid" ProbeUnsupported ProbeStatus = "unsupported" ProbeError ProbeStatus = "error" )
type ProjectAccessMethod ¶
type ProjectCleanup ¶
type ProjectCleanup struct {
// contains filtered or unexported fields
}
func (*ProjectCleanup) DeleteProjectData ¶
func (s *ProjectCleanup) DeleteProjectData(ctx context.Context, organization, project string) (ProjectCleanupResult, error)
DeleteProjectData performs the project cleanup sequence: catalog objects are removed first, then matching bucket scopes are listed and deleted in repository order. A scope count includes only successful deletions.
func (*ProjectCleanup) DeleteProjectObjects ¶
func (s *ProjectCleanup) DeleteProjectObjects(ctx context.Context, organization, project string, objectURLs []string) []DeleteResult
DeleteProjectObjects authorizes each URL against the resolved S3 scope, deduplicates in first-seen order, and dispatches exact physical URLs one at a time. This preserves per-item provider failures and retry ordering.
type ProjectCleanupResult ¶
type ProjectCleanupResult struct {
Organization string
ProjectID string
DeletedObjects int
DeletedBucketScopes int
}
ProjectCleanupResult is the plain result of deleting a project's catalog rows followed by its configured bucket scopes. HTTP adapters choose the wire representation.
type ProjectRecordAudit ¶
type ProjectRecordAudit struct {
ObjectID string
Checksum string
Organization string
Project string
Name string
Size int64
AccessURLs []string
AccessMethods []ProjectAccessMethod
CreatedTime time.Time
UpdatedTime *time.Time
}
ProjectRecordAudit is the plain projection used by project-record inspection. It intentionally retains physical duplicate rows and carries time values until the HTTP adapter chooses its wire format.
type ScopeCatalog ¶
type ScopeReader ¶
type Service ¶
type Service struct {
*Inspector
*ProjectCleanup
}
func NewService ¶
func NewService(deps Dependencies) *Service
type StorageObject ¶
type StorageObject struct {
ObjectURL string
Provider string
Bucket string
Key string
Path string
SizeBytes int64
MetaSHA256 string
ETag string
LastModTime time.Time
}
StorageObject is the provider-neutral inventory value exposed by this maintenance service. ObjectURL is always the canonical physical s3:// URL for project inventory.
type ValidationStatus ¶
type ValidationStatus string
const ( ValidationNotRequested ValidationStatus = "not_requested" ValidationMatched ValidationStatus = "matched" ValidationMismatched ValidationStatus = "mismatched" ValidationUnverifiable ValidationStatus = "unverifiable" )