diff --git a/cmd/appview/main.go b/cmd/appview/main.go index ac9603e..9f98904 100644 --- a/cmd/appview/main.go +++ b/cmd/appview/main.go @@ -1,22 +1,14 @@ package main import ( - "fmt" "os" - "time" "github.com/distribution/distribution/v3/registry" _ "github.com/distribution/distribution/v3/registry/auth/token" - _ "github.com/distribution/distribution/v3/registry/storage/driver/filesystem" _ "github.com/distribution/distribution/v3/registry/storage/driver/inmemory" - _ "github.com/distribution/distribution/v3/registry/storage/driver/s3-aws" // Register our custom middleware _ "atcr.io/pkg/middleware" - - "atcr.io/pkg/auth/oauth" - "atcr.io/pkg/auth/token" - "atcr.io/pkg/middleware" ) func main() { @@ -26,11 +18,3 @@ func main() { os.Exit(1) } } - -// Suppress unused import warnings -var _ = fmt.Sprint -var _ = os.Stdout -var _ = time.Now -var _ = oauth.NewRefresher -var _ = token.NewIssuer -var _ = middleware.SetGlobalRefresher diff --git a/pkg/storage/s3_blob_store.go b/pkg/storage/s3_blob_store.go deleted file mode 100644 index 89a3c02..0000000 --- a/pkg/storage/s3_blob_store.go +++ /dev/null @@ -1,54 +0,0 @@ -package storage - -import ( - "context" - - "github.com/distribution/distribution/v3" - "github.com/distribution/distribution/v3/registry/storage" - "github.com/distribution/distribution/v3/registry/storage/driver" - "github.com/distribution/reference" -) - -// S3BlobStore wraps distribution's blob store with S3 backend -type S3BlobStore struct { - distribution.BlobStore -} - -// NewS3BlobStore creates a new S3-backed blob store -func NewS3BlobStore(ctx context.Context, storageDriver driver.StorageDriver, repoName string) (*S3BlobStore, error) { - // Create a registry instance with the S3 driver - reg, err := storage.NewRegistry(ctx, storageDriver) - if err != nil { - return nil, err - } - - // Parse the repository name into a Named reference - named, err := reference.ParseNamed(repoName) - if err != nil { - return nil, err - } - - // Get the repository - repo, err := reg.Repository(ctx, named) - if err != nil { - return nil, err - } - - // Get the blob store - blobStore := repo.Blobs(ctx) - - return &S3BlobStore{ - BlobStore: blobStore, - }, nil -} - -// Note: S3BlobStore inherits all methods from distribution.BlobStore -// including: -// - Stat(ctx, dgst) - Check if blob exists -// - Get(ctx, dgst) - Retrieve blob -// - Open(ctx, dgst) - Open blob for reading -// - Put(ctx, mediaType, payload) - Store blob -// - Create(ctx, options...) - Create blob writer -// - Resume(ctx, id) - Resume blob upload -// - ServeBlob(ctx, w, r, dgst) - Serve blob over HTTP -// - Delete(ctx, dgst) - Delete blob