Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
func CompareVersions(version1 string, version2 string, timestamp1 time.Time, timestamp2 time.Time) int
CompareVersions implements the versioning strategy agreed upon in the discussion: 1. If both versions are valid semver, use semantic version comparison 2. If neither are valid semver, use publication timestamp (return 0 to indicate equal for sorting) 3. If one is semver and one is not, the semver version is always considered higher
func IsSemanticVersion ¶
IsSemanticVersion checks if a version string follows semantic versioning format Uses the official golang.org/x/mod/semver package for validation Requires exactly three parts: major.minor.patch (optionally with prerelease/build)
Types ¶
type RegistryService ¶
type RegistryService interface {
// Retrieve all servers with optional filtering
List(filter *database.ServerFilter, cursor string, limit int) ([]apiv0.ServerJSON, string, error)
// Retrieve a single server by registry metadata ID
GetByID(id string) (*apiv0.ServerJSON, error)
// Publish a server
Publish(req apiv0.ServerJSON) (*apiv0.ServerJSON, error)
// Update an existing server
EditServer(id string, req apiv0.ServerJSON) (*apiv0.ServerJSON, error)
}
RegistryService defines the interface for registry operations
func NewRegistryService ¶
func NewRegistryService(db database.Database, cfg *config.Config) RegistryService
NewRegistryService creates a new registry service with the provided database