Documentation
¶
Index ¶
- Variables
- type Catalog
- type Entity
- func (e *Entity) Collection() string
- func (e *Entity) CompanionFiles() []string
- func (e *Entity) FS(ctx context.Context) (fs.FS, error)
- func (e *Entity) ID() string
- func (e *Entity) ManifestPath() string
- func (e *Entity) Namespace() string
- func (e *Entity) QualifiedID() string
- func (e *Entity) RawManifest() []byte
- func (e *Entity) Shape() scan.EntityShape
- func (e *Entity) Unmarshal(v any) error
- type Options
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotQualified is returned when an identifier does not contain a namespace prefix. ErrNotQualified = errors.New("identifier is not qualified (want namespace.id)") // ErrNotFound is returned when a requested entity, collection, or namespace does not exist. ErrNotFound = errors.New("entity or namespace not found") // ErrLockStale indicates that catl.lock does not match declared dependencies in catl.toml. ErrLockStale = errors.New("catl.lock is out of date; run 'catl update'") // ErrTamperedVendor indicates that content in .catl/vendor does not match the recorded tree hash. ErrTamperedVendor = errors.New("vendor directory content does not match tree hash") // ErrRequiresNewer indicates that the configuration requires a newer version of the catl tool. ErrRequiresNewer = errors.New("configuration requires a newer version of catl") )
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog represents an immutable, validated catalog loaded into memory.
func OpenFS ¶
OpenFS reads and validates a catalog from an arbitrary fs.FS filesystem (such as testing/fstest.MapFS or embed.FS) without touching the local disk.
func (*Catalog) CollectionEntities ¶
CollectionEntities returns entities belonging to a specific collection, sorted by ID.
func (*Catalog) Entities ¶
Entities returns all entities across collections sorted deterministically.
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
Entity represents an addressable declarative item within a catalog collection.
func (*Entity) Collection ¶
Collection returns the collection name the entity belongs to (e.g. "flags").
func (*Entity) CompanionFiles ¶
CompanionFiles returns a slice of paths to companion files relative to the bundle directory. Returns an empty slice for flat entities.
func (*Entity) FS ¶
FS returns a read-only filesystem scoped to the bundle directory. It returns an error if called on a flat entity.
func (*Entity) ManifestPath ¶
ManifestPath returns the relative path from the catalog root to the manifest file.
func (*Entity) QualifiedID ¶
QualifiedID returns the canonical address of the entity: "namespace.id".
func (*Entity) RawManifest ¶
RawManifest returns the raw unparsed bytes of the entity manifest.
func (*Entity) Shape ¶
func (e *Entity) Shape() scan.EntityShape
Shape returns whether the entity is a flat single file or a bundle directory.