Documentation
¶
Index ¶
- func AppendAgent(original []byte, agent Agent) ([]byte, error)
- func AppendExport(original []byte, export Export) ([]byte, error)
- func Format(original []byte) ([]byte, error)
- func Marshal(m *Manifest) ([]byte, error)
- func MarshalLock(l *Lock) ([]byte, error)
- func RemoveAgent(original []byte, name string) ([]byte, error)
- func UpdateDependencies(original []byte, dependencies []Dependency) ([]byte, error)
- func UpdatePolicy(original []byte, intents [][2]string, may, mayNot *[]string, notes *string) ([]byte, error)
- type Agent
- type Consumers
- type Contact
- type Dependency
- type Export
- type Lock
- type LockedCardKey
- type LockedDependency
- type LockedVendor
- type Manifest
- type Module
- type MovedTo
- type Policy
- type Release
- type Require
- type Settings
- type Trust
- type Vendor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendAgent ¶ added in v1.1.0
AppendAgent edits only the agents sequence. Existing YAML nodes are retained so their comments, ordering, scalar spelling, and flow/block collection styles remain owned by the author rather than by the Go encoder.
func AppendExport ¶ added in v1.1.0
AppendExport edits only module.exports and retains every pre-existing module node.
func MarshalLock ¶
func RemoveAgent ¶ added in v1.1.0
RemoveAgent removes one matching agents item without rebuilding the remaining sequence.
func UpdateDependencies ¶
func UpdateDependencies(original []byte, dependencies []Dependency) ([]byte, error)
UpdateDependencies edits only the dependencies sequence in an existing manifest. YAML nodes retain comments, scalar styles, flow collections, and extension fields that are not owned by the dependency editor.
func UpdatePolicy ¶ added in v1.1.0
func UpdatePolicy(original []byte, intents [][2]string, may, mayNot *[]string, notes *string) ([]byte, error)
UpdatePolicy changes only the explicitly supplied policy fields. Nil pointers mean leave the field untouched; non-nil slices replace that consumer vocabulary list, including with empty.
Types ¶
type Agent ¶
type Agent struct {
Name string `yaml:"name" json:"name"`
Role string `yaml:"role" json:"role"`
Scope []string `yaml:"scope,omitempty" json:"scope,omitempty"`
Card string `yaml:"card,omitempty" json:"card,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Contacts []Contact `yaml:"contacts,omitempty" json:"contacts,omitempty"`
Trust *Trust `yaml:"trust,omitempty" json:"trust,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type Contact ¶
type Contact struct {
Intents []string `yaml:"intents" json:"intents"`
Kind string `yaml:"kind" json:"kind"`
Note string `yaml:"note,omitempty" json:"note,omitempty"`
URL string `yaml:"url,omitempty" json:"url,omitempty"`
Skill string `yaml:"skill,omitempty" json:"skill,omitempty"`
Address string `yaml:"address,omitempty" json:"address,omitempty"`
SubjectPrefix string `yaml:"subject-prefix,omitempty" json:"subject-prefix,omitempty"`
Repo string `yaml:"repo,omitempty" json:"repo,omitempty"`
Labels []string `yaml:"labels,omitempty" json:"labels,omitempty"`
Template string `yaml:"template,omitempty" json:"template,omitempty"`
Project string `yaml:"project,omitempty" json:"project,omitempty"`
IssueType string `yaml:"issue-type,omitempty" json:"issue-type,omitempty"`
Channel string `yaml:"channel,omitempty" json:"channel,omitempty"`
Handle string `yaml:"handle,omitempty" json:"handle,omitempty"`
Server string `yaml:"server,omitempty" json:"server,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
func (Contact) MarshalJSON ¶
type Dependency ¶
type Dependency struct {
ID string `yaml:"id,omitempty" json:"id,omitempty"`
Git string `yaml:"git" json:"git"`
Ref string `yaml:"ref,omitempty" json:"ref,omitempty"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Track string `yaml:"track,omitempty" json:"track,omitempty"`
Wire *[]string `yaml:"wire,omitempty" json:"wire,omitempty"`
Vendor *Vendor `yaml:"vendor,omitempty" json:"vendor,omitempty"`
Require *Require `yaml:"require,omitempty" json:"require,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type Lock ¶
type Lock struct {
Schema int `yaml:"schema" json:"schema"`
Dependencies map[string]LockedDependency `yaml:"dependencies" json:"dependencies"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type LockedCardKey ¶ added in v1.3.0
type LockedDependency ¶
type LockedDependency struct {
Git string `yaml:"git" json:"git"`
Ref string `yaml:"ref" json:"ref"`
Path string `yaml:"path" json:"path"`
Commit string `yaml:"commit" json:"commit"`
Manifest string `yaml:"manifest" json:"manifest"`
Cards map[string]string `yaml:"cards,omitempty" json:"cards,omitempty"`
CardsKeys map[string]LockedCardKey `yaml:"cards-keys,omitempty" json:"cards-keys,omitempty"`
Verified string `yaml:"verified,omitempty" json:"verified,omitempty"`
Surface string `yaml:"surface,omitempty" json:"surface,omitempty"`
Vendor *LockedVendor `yaml:"vendor,omitempty" json:"vendor,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type LockedVendor ¶ added in v1.2.0
type Manifest ¶
type Manifest struct {
Schema int `yaml:"schema" json:"schema"`
Module Module `yaml:"module" json:"module"`
Agents []Agent `yaml:"agents,omitempty" json:"agents,omitempty"`
Policy *Policy `yaml:"policy,omitempty" json:"policy,omitempty"`
Settings *Settings `yaml:"settings,omitempty" json:"settings,omitempty"`
Dependencies []Dependency `yaml:"dependencies,omitempty" json:"dependencies,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type Module ¶
type Module struct {
ID string `yaml:"id" json:"id"`
Name string `yaml:"name,omitempty" json:"name,omitempty"`
Description string `yaml:"description,omitempty" json:"description,omitempty"`
Languages []string `yaml:"languages,omitempty" json:"languages,omitempty"`
Surface string `yaml:"surface,omitempty" json:"surface,omitempty"`
Repository string `yaml:"repository,omitempty" json:"repository,omitempty"`
MovedTo *MovedTo `yaml:"moved-to,omitempty" json:"moved-to,omitempty"`
Docs string `yaml:"docs,omitempty" json:"docs,omitempty"`
Release *Release `yaml:"release,omitempty" json:"release,omitempty"`
Exports []Export `yaml:"exports,omitempty" json:"exports,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type MovedTo ¶
type MovedTo struct {
Git string `yaml:"git" json:"git"`
Path string `yaml:"path,omitempty" json:"path,omitempty"`
Notes string `yaml:"notes,omitempty" json:"notes,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
MovedTo is the owner's announcement, left at the old location, that the module now lives elsewhere. Consumers are told on update and follow it only on explicit request.
type Require ¶ added in v1.3.0
type Require struct {
Commits string `yaml:"commits,omitempty" json:"commits,omitempty"`
Signers string `yaml:"signers,omitempty" json:"signers,omitempty"`
Cards string `yaml:"cards,omitempty" json:"cards,omitempty"`
CardOrigin bool `yaml:"card-origin,omitempty" json:"card-origin,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type Settings ¶ added in v1.2.0
type Settings struct {
VendorDir string `yaml:"vendor-dir,omitempty" json:"vendor-dir,omitempty"`
SyncTargets []string `yaml:"sync-targets,omitempty" json:"sync-targets,omitempty"`
Organisation []string `yaml:"organisation,omitempty" json:"organisation,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}
type Trust ¶
type Trust struct {
Signatures bool `yaml:"signatures,omitempty" json:"signatures,omitempty"`
AcceptsExternal *bool `yaml:"accepts-external,omitempty" json:"accepts-external,omitempty"`
JWKS []string `yaml:"jwks,omitempty" json:"jwks,omitempty"`
Keys []string `yaml:"keys,omitempty" json:"keys,omitempty"`
Origins []string `yaml:"origins,omitempty" json:"origins,omitempty"`
JWKSMaxAge string `yaml:"jwks-max-age,omitempty" json:"jwks-max-age,omitempty"`
Extensions map[string]any `yaml:",inline" json:"-"`
}