add composer

This commit is contained in:
2025-11-17 10:16:27 +08:00
parent 6c6d5273ac
commit 8cff19ecca
10 changed files with 577 additions and 7 deletions

View File

@@ -0,0 +1,28 @@
// Package composer declares metadata for Composer (PHP) package proxying.
package composer
import (
"time"
"github.com/any-hub/any-hub/internal/hubmodule"
)
const composerDefaultTTL = 6 * time.Hour
func init() {
hubmodule.MustRegister(hubmodule.ModuleMetadata{
Key: "composer",
Description: "Composer packages proxy with metadata+dist caching",
MigrationState: hubmodule.MigrationStateBeta,
SupportedProtocols: []string{
"composer",
},
CacheStrategy: hubmodule.CacheStrategyProfile{
TTLHint: composerDefaultTTL,
ValidationMode: hubmodule.ValidationModeETag,
DiskLayout: "raw_path",
RequiresMetadataFile: false,
SupportsStreamingWrite: true,
},
})
}