Help us shape the future of Go! Take the 2026 Go Developer Survey

backend

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

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

func WithDefaultCopies(copies int) Option

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) CopyObject

func (*SynapseBackend) CreateBucket

func (b *SynapseBackend) CreateBucket(ctx context.Context, input *s3.CreateBucketInput, defaultACL []byte) 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 (*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 (b *SynapseBackend) GetBucketPolicy(ctx context.Context, bucket string) ([]byte, error)

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

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 (*SynapseBackend) ListBucketsAndOwners

func (b *SynapseBackend) ListBucketsAndOwners(ctx context.Context) ([]s3response.Bucket, error)

func (*SynapseBackend) ListMultipartUploads

func (*SynapseBackend) ListObjectVersions

ListObjectVersions lists object versions and delete markers with S3 markers and delimiter grouping.

func (*SynapseBackend) ListObjects

func (*SynapseBackend) ListObjectsV2

func (*SynapseBackend) ListParts

func (*SynapseBackend) PutBucketAcl

func (b *SynapseBackend) PutBucketAcl(ctx context.Context, bucket string, data []byte) error

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 (*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

Jump to

Keyboard shortcuts

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