Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultRegistry ¶
type DefaultRegistry struct {
// contains filtered or unexported fields
}
DefaultRegistry implements the FormatRegistry interface.
func (*DefaultRegistry) Get ¶
func (r *DefaultRegistry) Get(name string) (FormatHandler, error)
Get retrieves a handler by format name.
func (*DefaultRegistry) List ¶
func (r *DefaultRegistry) List() []string
List returns all registered format names.
func (*DefaultRegistry) Register ¶
func (r *DefaultRegistry) Register(handler FormatHandler) error
Register adds a new format handler.
func (*DefaultRegistry) Unregister ¶
func (r *DefaultRegistry) Unregister(name string) error
Unregister removes a format handler.
type FormatHandler ¶
type FormatHandler interface {
// Name returns the format name (e.g., "docker", "maven", "npm")
Name() string
// Validate checks if the artifact conforms to the format specification
Validate(ctx context.Context, data io.Reader) error
// Parse extracts metadata from the artifact
Parse(ctx context.Context, data io.Reader) (map[string]any, error)
// GetContentType returns the MIME type for this format
GetContentType() string
// GetFileExtension returns the typical file extension for this format
GetFileExtension() string
}
FormatHandler defines the interface for handling artifact format operations.
type FormatRegistry ¶
type FormatRegistry interface {
// Register adds a new format handler
Register(handler FormatHandler) error
// Get retrieves a handler by format name
Get(name string) (FormatHandler, error)
// List returns all registered format names
List() []string
// Unregister removes a format handler
Unregister(name string) error
}
FormatRegistry manages registered format handlers.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package base provides shared HTTP handler infrastructure for artifact format handlers.
|
Package base provides shared HTTP handler infrastructure for artifact format handlers. |
|
Package conan serves a hosted Conan 2 remote: the REST API (v2) the conan client speaks, with revisions.
|
Package conan serves a hosted Conan 2 remote: the REST API (v2) the conan client speaks, with revisions. |
|
Package formattest provides in-memory fakes shared by the format handler tests: a content-addressed blob store, a recording webhook publisher and a quarantine lookup.
|
Package formattest provides in-memory fakes shared by the format handler tests: a content-addressed blob store, a recording webhook publisher and a quarantine lookup. |