Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDeclined = errors.New("declined")
ErrDeclined marks a user-declined confirmation: a normal outcome that must exit 0 without touching the API.
Functions ¶
Types ¶
type EntityDef ¶
type EntityDef[T any] struct { Type client.EntityType PrimaryFlag string // positional-name flag, e.g. "title" PrimaryAttr string // its payload key PrimarySet func(*T, string) // writes the positional name onto the VO Flags []FlagDef[T] Relations []Relation Label func(*T) string // display label for pickers and output Detail func(*T) string // distinguishing info shown beside labels }
EntityDef describes one catalog entity type for the generic commands.
type ExitCoder ¶
ExitCoder lets subcommands pick their process exit code. Auth failures are 3 so scripts can react without parsing stderr.
type FlagDef ¶
type FlagDef[T any] struct { Name string // flag spelling, e.g. "short-title" Attr string // payload key sent to catalog-api (json tag) Usage string Repeated bool // flag may appear multiple times; value is a slice Set func(v *T, vals []string) (any, error) }
FlagDef binds one CLI property flag to a VO field. Set writes the field directly and returns the wire value for PATCH bodies, so renaming or removing that field in catalog-objects breaks the build here - the schema- drift check the design calls for.
type Relation ¶
type Relation struct {
Type string // counterpart entity type name
WireName string // relation key on the wire, e.g. "publisher"
Many bool
}
Relation names one modeled connection to another entity type. WireName is the JSON:API relation tag on the owning VO; Many marks array relations.