core

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CandidateToInternalObject

func CandidateToInternalObject(c drs.DrsObjectCandidate, now time.Time) (models.InternalObject, error)

CandidateToInternalObject converts a DRS registration candidate to our internal domain model.

func FirstSupportedAccessURL

func FirstSupportedAccessURL(obj *models.InternalObject) string

FirstSupportedAccessURL returns the first URL from an object that Syfon can sign.

func GetBaseURL

func GetBaseURL(ctx context.Context) string

GetBaseURL retrieves the base URL from the context.

func InternalObjectToInternalRecord

func InternalObjectToInternalRecord(obj models.InternalObject) internalapi.InternalRecord

InternalObjectToInternalRecord converts our internal domain model back to an API record.

func InternalObjectToInternalRecordResponse

func InternalObjectToInternalRecordResponse(obj models.InternalObject) internalapi.InternalRecordResponse

InternalObjectToInternalRecordResponse converts our internal domain model back to an API response.

func InternalRecordToInternalObject

func InternalRecordToInternalObject(r internalapi.InternalRecord, now time.Time) (models.InternalObject, error)

InternalRecordToInternalObject converts an index/internal record to our internal domain model.

func LFSCandidateToDRS

func LFSCandidateToDRS(in lfsapi.DrsObjectCandidate) drs.DrsObjectCandidate

LFSCandidateToDRS converts an LFS-specific candidate to a DRS-generic one.

func MergeInternalObjectUpdate

func MergeInternalObjectUpdate(existing models.InternalObject, update models.InternalObject, id string, now time.Time) (models.InternalObject, error)

MergeInternalObjectUpdate merges an update into an existing object.

func ObjectAccessResources added in v0.2.8

func ObjectAccessResources(obj *models.InternalObject) []string

func WithBaseURL

func WithBaseURL(ctx context.Context, baseURL string) context.Context

WithBaseURL adds the base URL to the context.

Types

type CanonicalStorageTarget added in v0.2.9

type CanonicalStorageTarget struct {
	Bucket string
	Key    string
	URL    string
}

type CanonicalStorageTargetRequest added in v0.2.9

type CanonicalStorageTargetRequest struct {
	Object         *models.InternalObject
	AccessURL      string
	Bucket         string
	Key            string
	PreferChecksum bool
}

type DeleteOptions added in v0.2.9

type DeleteOptions struct {
	DeleteStorageData bool
}

type ObjectManager

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

ObjectManager standardizes object lifecycle operations across all API surfaces.

func (*ObjectManager) BulkDeleteObjects

func (m *ObjectManager) BulkDeleteObjects(ctx context.Context, ids []string) error

func (*ObjectManager) BulkUpdateAccessMethods added in v0.2.5

func (m *ObjectManager) BulkUpdateAccessMethods(ctx context.Context, updates map[string][]drs.AccessMethod) error

func (*ObjectManager) CompleteMultipartUpload

func (m *ObjectManager) CompleteMultipartUpload(ctx context.Context, bucket, key, uploadID string, parts []urlmanager.MultipartPart) error

func (*ObjectManager) CreateBucketScope

func (m *ObjectManager) CreateBucketScope(ctx context.Context, scope *models.BucketScope) error

func (*ObjectManager) CreateObjectAlias

func (m *ObjectManager) CreateObjectAlias(ctx context.Context, aliasID, canonicalID string) error

func (*ObjectManager) DeleteBulkByScope added in v0.2.5

func (m *ObjectManager) DeleteBulkByScope(ctx context.Context, organization, project string) (int, error)

DeleteBulkByScope removes all objects matching an organization/project scope after verifying permissions.

func (*ObjectManager) DeleteObject

func (m *ObjectManager) DeleteObject(ctx context.Context, id string) error

func (*ObjectManager) DeleteObjectWithOptions added in v0.2.9

func (m *ObjectManager) DeleteObjectWithOptions(ctx context.Context, id string, opts DeleteOptions) error

func (*ObjectManager) DeleteObjectsByChecksums added in v0.2.8

func (m *ObjectManager) DeleteObjectsByChecksums(ctx context.Context, hashes []string) (int, error)

func (*ObjectManager) DeleteS3Credential

func (m *ObjectManager) DeleteS3Credential(ctx context.Context, bucket string) error

func (*ObjectManager) GetBulkObjects

func (m *ObjectManager) GetBulkObjects(ctx context.Context, ids []string, requiredMethod string) ([]models.InternalObject, error)

func (*ObjectManager) GetObject

func (m *ObjectManager) GetObject(ctx context.Context, ident string, requiredMethod string) (*models.InternalObject, error)

GetObject retrieves an internal object by ID, Alias, or Checksum and validates access.

func (*ObjectManager) GetObjectsByChecksum

func (m *ObjectManager) GetObjectsByChecksum(ctx context.Context, checksum string, requiredMethod string) ([]models.InternalObject, error)

func (*ObjectManager) GetObjectsByChecksums

func (m *ObjectManager) GetObjectsByChecksums(ctx context.Context, hashes []string, requiredMethod string) (map[string][]models.InternalObject, error)

func (*ObjectManager) GetPendingLFSMeta

func (m *ObjectManager) GetPendingLFSMeta(ctx context.Context, oid string) (*models.PendingLFSMeta, error)

func (*ObjectManager) GetS3Credential

func (m *ObjectManager) GetS3Credential(ctx context.Context, bucket string) (*models.S3Credential, error)

func (*ObjectManager) GetServiceInfo

func (m *ObjectManager) GetServiceInfo(ctx context.Context) (*drs.Service, error)

func (*ObjectManager) InitMultipartUpload

func (m *ObjectManager) InitMultipartUpload(ctx context.Context, bucket, key string) (string, error)

func (*ObjectManager) ListBucketScopes

func (m *ObjectManager) ListBucketScopes(ctx context.Context) ([]models.BucketScope, error)

func (*ObjectManager) ListObjectIDsByScope added in v0.2.5

func (m *ObjectManager) ListObjectIDsByScope(ctx context.Context, organization, project string, requiredMethod string) ([]string, error)

func (*ObjectManager) ListObjectIDsPageByChecksum added in v0.2.8

func (m *ObjectManager) ListObjectIDsPageByChecksum(ctx context.Context, checksum, checksumType, organization, project, requiredMethod, startAfter string, limit, offset int) ([]string, error)

func (*ObjectManager) ListObjectIDsPageByScope added in v0.2.8

func (m *ObjectManager) ListObjectIDsPageByScope(ctx context.Context, organization, project, requiredMethod, startAfter string, limit, offset int) ([]string, error)

func (*ObjectManager) ListObjectIDsPageByURL added in v0.2.8

func (m *ObjectManager) ListObjectIDsPageByURL(ctx context.Context, objectURL, organization, project, requiredMethod, startAfter string, limit, offset int) ([]string, error)

func (*ObjectManager) ListS3Credentials

func (m *ObjectManager) ListS3Credentials(ctx context.Context) ([]models.S3Credential, error)

func (*ObjectManager) ListVisibleBuckets added in v0.2.8

func (m *ObjectManager) ListVisibleBuckets(ctx context.Context) (map[string]VisibleBucket, error)

func (*ObjectManager) PopPendingLFSMeta

func (m *ObjectManager) PopPendingLFSMeta(ctx context.Context, oid string) (*models.PendingLFSMeta, error)

func (*ObjectManager) RecordDownload

func (m *ObjectManager) RecordDownload(ctx context.Context, id string) error

func (*ObjectManager) RecordProviderTransferEvents added in v0.2.5

func (m *ObjectManager) RecordProviderTransferEvents(ctx context.Context, events []models.ProviderTransferEvent) error

func (*ObjectManager) RecordTransferAttributionEvents added in v0.2.5

func (m *ObjectManager) RecordTransferAttributionEvents(ctx context.Context, events []models.TransferAttributionEvent) error

func (*ObjectManager) RecordUpload

func (m *ObjectManager) RecordUpload(ctx context.Context, id string) error

func (*ObjectManager) RegisterBulk

func (m *ObjectManager) RegisterBulk(ctx context.Context, candidates []drs.DrsObjectCandidate) (int, error)

RegisterBulk saves multiple internal objects as a single logical operation.

func (*ObjectManager) RegisterObjects

func (m *ObjectManager) RegisterObjects(ctx context.Context, objs []models.InternalObject) error

func (*ObjectManager) RemoveObjectControlledAccess added in v0.2.9

func (m *ObjectManager) RemoveObjectControlledAccess(ctx context.Context, objectID, resource string) (*models.InternalObject, error)

func (*ObjectManager) ReplaceObjects added in v0.2.8

func (m *ObjectManager) ReplaceObjects(ctx context.Context, objs []models.InternalObject) error

func (*ObjectManager) RequireObjectResources added in v0.2.8

func (m *ObjectManager) RequireObjectResources(ctx context.Context, method string, resources []string) error

func (*ObjectManager) ResolveBucket

func (m *ObjectManager) ResolveBucket(ctx context.Context, bucketName string) (string, error)

ResolveBucket validates a bucket name or returns the default one.

func (*ObjectManager) ResolveCanonicalStorageTarget added in v0.2.9

func (m *ObjectManager) ResolveCanonicalStorageTarget(ctx context.Context, req CanonicalStorageTargetRequest) (CanonicalStorageTarget, error)

func (*ObjectManager) ResolveScopedUploadTarget added in v0.2.9

func (m *ObjectManager) ResolveScopedUploadTarget(ctx context.Context, organization, project, key string) (CanonicalStorageTarget, error)

func (*ObjectManager) SavePendingLFSMeta

func (m *ObjectManager) SavePendingLFSMeta(ctx context.Context, entries []models.PendingLFSMeta) error

func (*ObjectManager) SaveS3Credential

func (m *ObjectManager) SaveS3Credential(ctx context.Context, cred *models.S3Credential) error

func (*ObjectManager) SignDownloadPart

func (m *ObjectManager) SignDownloadPart(ctx context.Context, bucket, accessURL string, start, end int64, options urlmanager.SignOptions) (string, error)

func (*ObjectManager) SignMultipartPart

func (m *ObjectManager) SignMultipartPart(ctx context.Context, bucket, key, uploadID string, partNum int32) (string, error)

func (*ObjectManager) SignObjectDownloadPart added in v0.2.8

func (m *ObjectManager) SignObjectDownloadPart(ctx context.Context, obj *models.InternalObject, bucket, accessURL string, start, end int64, options urlmanager.SignOptions) (string, error)

func (*ObjectManager) SignObjectURL added in v0.2.8

func (m *ObjectManager) SignObjectURL(ctx context.Context, obj *models.InternalObject, accessURL string, options urlmanager.SignOptions) (string, error)

func (*ObjectManager) SignURL

func (m *ObjectManager) SignURL(ctx context.Context, accessURL string, options urlmanager.SignOptions) (string, error)

SignURL generates a signed URL for an object's access method.

func (*ObjectManager) UpdateObjectAccessMethods added in v0.2.5

func (m *ObjectManager) UpdateObjectAccessMethods(ctx context.Context, objectID string, accessMethods []drs.AccessMethod) error

type VisibleBucket added in v0.2.8

type VisibleBucket struct {
	Credential models.S3Credential
	Programs   []string
}

Jump to

Keyboard shortcuts

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