manifest

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CurrentSchema = 2
	CanonicalName = "a2amodule.yml"
	AlternateName = "a2amodule.yaml"
)

Variables

This section is empty.

Functions

func Marshal

func Marshal(m *Manifest) ([]byte, error)

func MarshalLock

func MarshalLock(l *Lock) ([]byte, error)

func Path

func Path(root string) (string, error)

func ReadDir

func ReadDir(root string) ([]byte, string, error)

func Sort

func Sort(m *Manifest)

Types

type Agent

type Agent struct {
	Name string `yaml:"name,omitempty" json:"name,omitempty"`
	Card string `yaml:"card" json:"card"`
}

type Binding

type Binding struct {
	Adapter string `yaml:"adapter" json:"adapter"`
	Variant string `yaml:"variant" json:"variant"`
	Export  string `yaml:"export,omitempty" json:"export,omitempty"`
	Path    string `yaml:"path,omitempty" json:"path,omitempty"`
}

type Component

type Component struct {
	ID          string   `yaml:"id" json:"id"`
	Description string   `yaml:"description,omitempty" json:"description,omitempty"`
	Repository  string   `yaml:"repository,omitempty" json:"repository,omitempty"`
	Exports     []Export `yaml:"exports,omitempty" json:"exports,omitempty"`
	Surface     string   `yaml:"surface,omitempty" json:"surface,omitempty"`
}

type Dependency

type Dependency struct {
	Name     string    `yaml:"name" json:"name"`
	Git      string    `yaml:"git" json:"git"`
	Ref      string    `yaml:"ref,omitempty" json:"ref,omitempty"`
	Path     string    `yaml:"path,omitempty" json:"path,omitempty"`
	Bindings []Binding `yaml:"bindings,omitempty" json:"bindings,omitempty"`
}

Dependency.Name is the consumer-local alias. Component identity is learned from the upstream manifest and is never used as the local map key.

func DependencyByName

func DependencyByName(m *Manifest, name string) (*Dependency, int)

type Export

type Export struct {
	Adapter  string `yaml:"adapter" json:"adapter"`
	Name     string `yaml:"name" json:"name"`
	Path     string `yaml:"path,omitempty" json:"path,omitempty"`
	Checksum string `yaml:"checksum,omitempty" json:"checksum,omitempty"`
}

type Lock

type Lock struct {
	Schema       int                         `yaml:"schema" json:"schema"`
	Dependencies map[string]LockedDependency `yaml:"dependencies" json:"dependencies"`
}

func LoadLock

func LoadLock(path string) (*Lock, error)

func (*Lock) Validate

func (l *Lock) Validate() error

type LockedAgent

type LockedAgent struct {
	Name         string `yaml:"name,omitempty" json:"name,omitempty"`
	DeclaredCard string `yaml:"declaredCard" json:"declaredCard"`
	Card         string `yaml:"card" json:"card"`
	Commit       string `yaml:"commit" json:"commit"`
}

LockedAgent records both the upstream declaration and the reference a local consumer can actually use. For repository-relative cards, Card points below .git-a2a while Commit identifies the Git object the bytes came from.

type LockedDependency

type LockedDependency struct {
	Component string      `yaml:"component" json:"component"`
	Git       string      `yaml:"git" json:"git"`
	Ref       string      `yaml:"ref" json:"ref"`
	Path      string      `yaml:"path,omitempty" json:"path,omitempty"`
	Commit    string      `yaml:"commit" json:"commit"`
	Manifest  string      `yaml:"manifest" json:"manifest"`
	Bindings  []Binding   `yaml:"bindings" json:"bindings"`
	Agent     LockedAgent `yaml:"agent" json:"agent"`
	Surface   string      `yaml:"surface,omitempty" json:"surface,omitempty"`
}

type Manifest

type Manifest struct {
	Schema       int          `yaml:"schema" json:"schema"`
	Component    Component    `yaml:"component" json:"component"`
	Agent        *Agent       `yaml:"agent,omitempty" json:"agent,omitempty"`
	Dependencies []Dependency `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
}

Manifest is the schema 2 repository declaration. It contains one component, one responsible external agent, and direct dependencies only.

func Load

func Load(path string) (*Manifest, error)

func LoadDir

func LoadDir(root string) (*Manifest, error)

func Parse

func Parse(b []byte) (*Manifest, error)

func (*Manifest) Validate

func (m *Manifest) Validate() error

type UnsupportedSchemaError

type UnsupportedSchemaError struct{ Schema int }

func (*UnsupportedSchemaError) Error

func (e *UnsupportedSchemaError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL