Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct {
Alias string // Primary key - unique identifier
SourceType SourceType // Origin: "file" or "virtual"
FilePath string // Source file path (empty for virtual specs)
Checksum string // SHA256 hash of spec content
Spec *openapi3.T // The actual spec
Metadata map[string]string // Custom metadata
LoadedAt time.Time // When the spec was loaded
}
Entry represents a single OpenAPI specification in the registry.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages a collection of OpenAPI specifications in memory.
func (*Registry) Add ¶
Add adds or updates a spec entry in the registry. FilePath should be empty string for virtual specs.
Collision detection logic: - Alias must be globally unique (regardless of source type) - File + File with same alias but different path: collision error - File + File with same alias, same path, same checksum: idempotent no-op - File + File with same alias, same path, different checksum: update - Virtual + Virtual with same alias, different checksum: update - Virtual + Virtual with same alias, same checksum: idempotent no-op - File + Virtual or Virtual + File with same alias: collision error.
func (*Registry) GetByAlias ¶
GetByAlias retrieves a spec entry by alias. Returns an error if the spec doesn't exist.
type SourceType ¶
type SourceType string
SourceType represents the origin of a spec entry.
const ( // SourceTypeFile represents a spec loaded from a file. SourceTypeFile SourceType = "file" // SourceTypeVirtual represents a spec created by transformations. SourceTypeVirtual SourceType = "virtual" )