Documentation
¶
Index ¶
- type Option
- func WithCacheEvictionMessages(messages *taskengine.Messenger) Option
- func WithDefaultCopies(copies int) Option
- func WithEvictionPolicy(policy cache.EvictionPolicy) Option
- func WithTaskService(service *taskengine.Service) Option
- func WithTransferCounters(counters *observability.TransferCounters) Option
- type SynapseBackend
- func (b *SynapseBackend) AbortMultipartUpload(ctx context.Context, input *s3.AbortMultipartUploadInput) error
- func (b *SynapseBackend) ChangeBucketOwner(ctx context.Context, bucket, owner string) error
- func (b *SynapseBackend) CompleteMultipartUpload(ctx context.Context, input *s3.CompleteMultipartUploadInput) (s3response.CompleteMultipartUploadResult, string, error)
- func (b *SynapseBackend) CopyObject(ctx context.Context, input s3response.CopyObjectInput) (s3response.CopyObjectOutput, error)
- func (b *SynapseBackend) CreateBucket(ctx context.Context, input *s3.CreateBucketInput, defaultACL []byte) error
- func (b *SynapseBackend) CreateMultipartUpload(ctx context.Context, input s3response.CreateMultipartUploadInput) (s3response.InitiateMultipartUploadResult, error)
- func (b *SynapseBackend) DeleteBucketOwnershipControls(ctx context.Context, bucket string) error
- func (b *SynapseBackend) DeleteBucketPolicy(ctx context.Context, bucket string) error
- func (b *SynapseBackend) DeleteObject(ctx context.Context, input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error)
- func (b *SynapseBackend) DeleteObjects(ctx context.Context, input *s3.DeleteObjectsInput) (s3response.DeleteResult, error)
- func (b *SynapseBackend) DiscardOrphanedContents(ctx context.Context, createdBefore time.Time) (discarded, failed int, err error)
- func (b *SynapseBackend) GetBucketAcl(ctx context.Context, input *s3.GetBucketAclInput) ([]byte, error)
- func (b *SynapseBackend) GetBucketOwnershipControls(ctx context.Context, bucket string) (types.ObjectOwnership, error)
- func (b *SynapseBackend) GetBucketPolicy(ctx context.Context, bucket string) ([]byte, error)
- func (b *SynapseBackend) GetBucketTagging(ctx context.Context, bucket string) (map[string]string, error)
- func (b *SynapseBackend) GetBucketVersioning(ctx context.Context, bucket string) (s3response.GetBucketVersioningOutput, error)
- func (b *SynapseBackend) GetObject(ctx context.Context, input *s3.GetObjectInput) (*s3.GetObjectOutput, error)
- func (b *SynapseBackend) GetObjectAcl(ctx context.Context, input *s3.GetObjectAclInput) (*s3.GetObjectAclOutput, error)
- func (b *SynapseBackend) GetObjectAttributes(ctx context.Context, input *s3.GetObjectAttributesInput) (s3response.GetObjectAttributesResponse, error)
- func (b *SynapseBackend) GetObjectLockConfiguration(ctx context.Context, bucket string) ([]byte, error)
- func (b *SynapseBackend) HeadBucket(ctx context.Context, input *s3.HeadBucketInput) (*s3.HeadBucketOutput, error)
- func (b *SynapseBackend) HeadObject(ctx context.Context, input *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)
- func (b *SynapseBackend) ListBuckets(ctx context.Context, input s3response.ListBucketsInput) (s3response.ListAllMyBucketsResult, error)
- func (b *SynapseBackend) ListBucketsAndOwners(ctx context.Context) ([]s3response.Bucket, error)
- func (b *SynapseBackend) ListMultipartUploads(ctx context.Context, input *s3.ListMultipartUploadsInput) (s3response.ListMultipartUploadsResult, error)
- func (b *SynapseBackend) ListObjectVersions(ctx context.Context, input *s3.ListObjectVersionsInput) (s3response.ListVersionsResult, error)
- func (b *SynapseBackend) ListObjects(ctx context.Context, input *s3.ListObjectsInput) (s3response.ListObjectsResult, error)
- func (b *SynapseBackend) ListObjectsV2(ctx context.Context, input *s3.ListObjectsV2Input) (s3response.ListObjectsV2Result, error)
- func (b *SynapseBackend) ListParts(ctx context.Context, input *s3.ListPartsInput) (s3response.ListPartsResult, error)
- func (b *SynapseBackend) PutBucketAcl(ctx context.Context, bucket string, data []byte) error
- func (b *SynapseBackend) PutBucketOwnershipControls(ctx context.Context, bucket string, ownership types.ObjectOwnership) error
- func (b *SynapseBackend) PutBucketVersioning(ctx context.Context, bucket string, status types.BucketVersioningStatus) error
- func (b *SynapseBackend) PutObject(ctx context.Context, input s3response.PutObjectInput) (s3response.PutObjectOutput, error)
- func (b *SynapseBackend) PutObjectAcl(ctx context.Context, input *s3.PutObjectAclInput) error
- func (b *SynapseBackend) ReleaseInterruptedMultipartCompletions(ctx context.Context) (int64, error)
- func (b *SynapseBackend) RestoreObjectVersion(ctx context.Context, ...) (string, error)
- func (b *SynapseBackend) Shutdown()
- func (b *SynapseBackend) String() string
- func (b *SynapseBackend) UploadPart(ctx context.Context, input *s3.UploadPartInput) (*s3.UploadPartOutput, error)
- func (b *SynapseBackend) UploadPartCopy(ctx context.Context, input *s3.UploadPartCopyInput) (s3response.CopyPartResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*SynapseBackend)
Option configures SynapseBackend runtime behavior.
func WithCacheEvictionMessages ¶
func WithCacheEvictionMessages(messages *taskengine.Messenger) Option
func WithDefaultCopies ¶
WithDefaultCopies sets the replica target recorded on content the first time its bytes are written. A bucket override still wins.
func WithEvictionPolicy ¶
func WithEvictionPolicy(policy cache.EvictionPolicy) Option
WithEvictionPolicy configures automatic local cache eviction.
func WithTaskService ¶
func WithTaskService(service *taskengine.Service) Option
WithTaskService configures the sole task creation boundary.
func WithTransferCounters ¶
func WithTransferCounters(counters *observability.TransferCounters) Option
type SynapseBackend ¶
type SynapseBackend struct {
backend.BackendUnsupported // provides ErrNotImplemented for unimplemented methods
// contains filtered or unexported fields
}
SynapseBackend implements the VersityGW backend.Backend interface, bridging S3 operations to Filecoin via the Synapse SDK.
func New ¶
func New( repos *repository.Repositories, c cache.Cache, sc synapse.StorageClient, cacheGate *cacheaccess.Gate, cacheAccessTracker *cacheaccess.Tracker, logger *slog.Logger, opts ...Option, ) *SynapseBackend
New creates a new SynapseBackend.
func (*SynapseBackend) AbortMultipartUpload ¶
func (b *SynapseBackend) AbortMultipartUpload(ctx context.Context, input *s3.AbortMultipartUploadInput) error
func (*SynapseBackend) ChangeBucketOwner ¶
func (b *SynapseBackend) ChangeBucketOwner(ctx context.Context, bucket, owner string) error
func (*SynapseBackend) CompleteMultipartUpload ¶
func (b *SynapseBackend) CompleteMultipartUpload(ctx context.Context, input *s3.CompleteMultipartUploadInput) (s3response.CompleteMultipartUploadResult, string, error)
func (*SynapseBackend) CopyObject ¶
func (b *SynapseBackend) CopyObject(ctx context.Context, input s3response.CopyObjectInput) (s3response.CopyObjectOutput, error)
func (*SynapseBackend) CreateBucket ¶
func (b *SynapseBackend) CreateBucket(ctx context.Context, input *s3.CreateBucketInput, defaultACL []byte) error
func (*SynapseBackend) CreateMultipartUpload ¶
func (b *SynapseBackend) CreateMultipartUpload(ctx context.Context, input s3response.CreateMultipartUploadInput) (s3response.InitiateMultipartUploadResult, error)
func (*SynapseBackend) DeleteBucketOwnershipControls ¶
func (b *SynapseBackend) DeleteBucketOwnershipControls(ctx context.Context, bucket string) error
func (*SynapseBackend) DeleteBucketPolicy ¶
func (b *SynapseBackend) DeleteBucketPolicy(ctx context.Context, bucket string) error
func (*SynapseBackend) DeleteObject ¶
func (b *SynapseBackend) DeleteObject(ctx context.Context, input *s3.DeleteObjectInput) (*s3.DeleteObjectOutput, error)
func (*SynapseBackend) DeleteObjects ¶
func (b *SynapseBackend) DeleteObjects(ctx context.Context, input *s3.DeleteObjectsInput) (s3response.DeleteResult, error)
func (*SynapseBackend) DiscardOrphanedContents ¶
func (b *SynapseBackend) DiscardOrphanedContents(ctx context.Context, createdBefore time.Time) (discarded, failed int, err error)
DiscardOrphanedContents deletes content created before createdBefore that no object version has ever named: rows a write left when the process stopped between resolving its content and committing its version. Each content is handled on its own; one that fails is logged and retried on the next start.
func (*SynapseBackend) GetBucketAcl ¶
func (b *SynapseBackend) GetBucketAcl(ctx context.Context, input *s3.GetBucketAclInput) ([]byte, error)
GetBucketAcl returns the persisted ACL for the specified bucket.
func (*SynapseBackend) GetBucketOwnershipControls ¶
func (b *SynapseBackend) GetBucketOwnershipControls(ctx context.Context, bucket string) (types.ObjectOwnership, error)
GetBucketOwnershipControls returns an ACL-compatible ownership mode.
func (*SynapseBackend) GetBucketPolicy ¶
func (*SynapseBackend) GetBucketTagging ¶
func (b *SynapseBackend) GetBucketTagging(ctx context.Context, bucket string) (map[string]string, error)
GetBucketTagging returns no tags for the specified bucket.
func (*SynapseBackend) GetBucketVersioning ¶
func (b *SynapseBackend) GetBucketVersioning(ctx context.Context, bucket string) (s3response.GetBucketVersioningOutput, error)
GetBucketVersioning reports that SynapS3 buckets are always versioning-enabled.
func (*SynapseBackend) GetObject ¶
func (b *SynapseBackend) GetObject(ctx context.Context, input *s3.GetObjectInput) (*s3.GetObjectOutput, error)
func (*SynapseBackend) GetObjectAcl ¶
func (b *SynapseBackend) GetObjectAcl(ctx context.Context, input *s3.GetObjectAclInput) (*s3.GetObjectAclOutput, error)
GetObjectAcl returns an empty ACL for the specified object. TODO: verify object exists and return NoSuchKey for missing keys.
func (*SynapseBackend) GetObjectAttributes ¶
func (b *SynapseBackend) GetObjectAttributes(ctx context.Context, input *s3.GetObjectAttributesInput) (s3response.GetObjectAttributesResponse, error)
GetObjectAttributes returns object metadata and honors an explicit versionId.
func (*SynapseBackend) GetObjectLockConfiguration ¶
func (b *SynapseBackend) GetObjectLockConfiguration(ctx context.Context, bucket string) ([]byte, error)
GetObjectLockConfiguration reports that object lock is not configured.
func (*SynapseBackend) HeadBucket ¶
func (b *SynapseBackend) HeadBucket(ctx context.Context, input *s3.HeadBucketInput) (*s3.HeadBucketOutput, error)
func (*SynapseBackend) HeadObject ¶
func (b *SynapseBackend) HeadObject(ctx context.Context, input *s3.HeadObjectInput) (*s3.HeadObjectOutput, error)
func (*SynapseBackend) ListBuckets ¶
func (b *SynapseBackend) ListBuckets(ctx context.Context, input s3response.ListBucketsInput) (s3response.ListAllMyBucketsResult, error)
func (*SynapseBackend) ListBucketsAndOwners ¶
func (b *SynapseBackend) ListBucketsAndOwners(ctx context.Context) ([]s3response.Bucket, error)
func (*SynapseBackend) ListMultipartUploads ¶
func (b *SynapseBackend) ListMultipartUploads(ctx context.Context, input *s3.ListMultipartUploadsInput) (s3response.ListMultipartUploadsResult, error)
func (*SynapseBackend) ListObjectVersions ¶
func (b *SynapseBackend) ListObjectVersions(ctx context.Context, input *s3.ListObjectVersionsInput) (s3response.ListVersionsResult, error)
ListObjectVersions lists object versions and delete markers with S3 markers and delimiter grouping.
func (*SynapseBackend) ListObjects ¶
func (b *SynapseBackend) ListObjects(ctx context.Context, input *s3.ListObjectsInput) (s3response.ListObjectsResult, error)
func (*SynapseBackend) ListObjectsV2 ¶
func (b *SynapseBackend) ListObjectsV2(ctx context.Context, input *s3.ListObjectsV2Input) (s3response.ListObjectsV2Result, error)
func (*SynapseBackend) ListParts ¶
func (b *SynapseBackend) ListParts(ctx context.Context, input *s3.ListPartsInput) (s3response.ListPartsResult, error)
func (*SynapseBackend) PutBucketAcl ¶
PutBucketAcl persists bucket ACL updates used by VersityGW access control.
func (*SynapseBackend) PutBucketOwnershipControls ¶
func (b *SynapseBackend) PutBucketOwnershipControls(ctx context.Context, bucket string, ownership types.ObjectOwnership) error
func (*SynapseBackend) PutBucketVersioning ¶
func (b *SynapseBackend) PutBucketVersioning(ctx context.Context, bucket string, status types.BucketVersioningStatus) error
PutBucketVersioning accepts Enabled because SynapS3 enforces versioning for every bucket.
func (*SynapseBackend) PutObject ¶
func (b *SynapseBackend) PutObject(ctx context.Context, input s3response.PutObjectInput) (s3response.PutObjectOutput, error)
func (*SynapseBackend) PutObjectAcl ¶
func (b *SynapseBackend) PutObjectAcl(ctx context.Context, input *s3.PutObjectAclInput) error
PutObjectAcl accepts and discards object-level ACL updates. TODO: verify object exists and return NoSuchKey for missing keys.
func (*SynapseBackend) ReleaseInterruptedMultipartCompletions ¶
func (b *SynapseBackend) ReleaseInterruptedMultipartCompletions(ctx context.Context) (int64, error)
ReleaseInterruptedMultipartCompletions lets uploads that a stopped process left completing be completed or aborted again. It must run before the S3 server accepts requests, while no completion can be in flight.
func (*SynapseBackend) RestoreObjectVersion ¶
func (b *SynapseBackend) RestoreObjectVersion(ctx context.Context, bucketName, key, sourceVersionID, expectedCurrentVersionID string) (string, error)
RestoreObjectVersion copies a selected data version to a new current version of the same object.
func (*SynapseBackend) Shutdown ¶
func (b *SynapseBackend) Shutdown()
func (*SynapseBackend) String ¶
func (b *SynapseBackend) String() string
func (*SynapseBackend) UploadPart ¶
func (b *SynapseBackend) UploadPart(ctx context.Context, input *s3.UploadPartInput) (*s3.UploadPartOutput, error)
func (*SynapseBackend) UploadPartCopy ¶
func (b *SynapseBackend) UploadPartCopy(ctx context.Context, input *s3.UploadPartCopyInput) (s3response.CopyPartResult, error)