Documentation
¶
Overview ¶
Package cardmetadata prepares and transactionally materializes repository- relative Agent Cards. It deliberately treats cards as opaque Git blobs: the bytes are neither parsed nor rewritten.
Index ¶
- func Apply(root, alias string, prepared Prepared) (restore func() error, finalize func(), err error)
- func ForList(root, alias string, locked manifest.LockedAgent) (manifest.LockedAgent, []string)
- func Remove(root, alias string) (restore func() error, finalize func(), err error)
- func ResolvedPath(alias string) string
- type FileFetcher
- type Prepared
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(root, alias string, prepared Prepared) (restore func() error, finalize func(), err error)
Apply replaces the alias metadata atomically. For an HTTPS card this removes an obsolete local snapshot. The returned restore and finalize callbacks let lifecycle include the operation in its wider dependency transaction.
func ForList ¶
func ForList(root, alias string, locked manifest.LockedAgent) (manifest.LockedAgent, []string)
ForList returns a copy suitable for offline list output. A missing or unsafe local file is never returned as a usable card reference.
func ResolvedPath ¶
ResolvedPath returns the stable consumer-relative reference used in locks and list output for a repository-relative card.
Types ¶
type FileFetcher ¶
type FileFetcher interface {
File(ctx context.Context, source, commit, filePath string) ([]byte, error)
}
FileFetcher reads one byte-exact file from a resolved Git commit.
type Prepared ¶
type Prepared struct {
Agent manifest.LockedAgent
// contains filtered or unexported fields
}
Prepared is read-only preparation for a later transactional Apply.
func Prepare ¶
func Prepare(ctx context.Context, fetcher FileFetcher, alias, source, commit, manifestRoot string, agent manifest.Agent) (Prepared, error)
Prepare resolves an upstream card declaration. HTTPS references remain external; repository-relative declarations are fetched relative to the upstream manifest root from the already resolved commit.