Documentation
¶
Overview ¶
Package catalog holds the descriptors that say how a Forge extension declares its backends, and the recipes that can host those backends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog struct {
Descriptors map[string]Descriptor // by extension name
Recipes map[string]Recipe // by id
}
func Load ¶
func Load(ctx context.Context, projectRoot string, modules []Module) (*Catalog, output.Diagnostics, error)
Load returns the embedded catalog with module-shipped and project-local descriptors applied on top, in that order. A descriptor with a schema newer than this CLI reads is reported and skipped.
func (*Catalog) DescriptorFor ¶
func (c *Catalog) DescriptorFor(extension string) (Descriptor, bool)
DescriptorFor returns the descriptor for an extension name.
type Descriptor ¶
type Descriptor struct {
Schema int `yaml:"schema"`
Extension string `yaml:"extension"`
ConfigKey string `yaml:"config_key"`
Instances *Instances `yaml:"instances,omitempty"`
Kinds map[string]model.ResourceType `yaml:"kinds,omitempty"`
Bind map[string]string `yaml:"bind,omitempty"`
Requires []Requirement `yaml:"requires,omitempty"`
Optional []OptionalRequirement `yaml:"optional,omitempty"`
Migrations *Migrations `yaml:"migrations,omitempty"`
Source string `yaml:"-"` // "embedded", module path, or project file
}
func (Descriptor) KindOf ¶
func (d Descriptor) KindOf(value string) (model.ResourceType, bool)
KindOf maps a driver value or DSN to a resource type through the descriptor's kinds table. For a DSN the scheme before ':' is used. ok is false when the value is unknown; an empty type with ok true means embedded.
type Migrations ¶
type Migrations struct {
Owner bool `yaml:"owner"`
}
type OptionalRequirement ¶
type OptionalRequirement struct {
Kind model.ResourceType `yaml:"kind"`
When *Condition `yaml:"when,omitempty"`
Bind map[string]string `yaml:"bind,omitempty"`
}
type Recipe ¶
type Recipe = model.RuntimeRecipe
type Requirement ¶
Click to show internal directories.
Click to hide internal directories.