Documentation
¶
Overview ¶
Package manifest loads and validates module.yaml manifests into typed structs. See docs/architecture.md for the manifest schema.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dependency ¶
type Dependency struct {
Module string `yaml:"module"`
Package string `yaml:"package"`
Version string `yaml:"version"`
}
Dependency is a single dependency contributed to the generated project's dependency manifest. Exactly one of Module (Go) or Package (npm) is set, matching the language it appears under.
type EnvVar ¶
type EnvVar struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Required bool `yaml:"required"`
Default string `yaml:"default"` // must be empty when Required is true
}
EnvVar describes one environment variable a project needs to configure when the declaring module is selected.
type FieldError ¶
FieldError describes a single validation failure at a field path, e.g. "languages.go.templates[0].to".
func (FieldError) Error ¶
func (e FieldError) Error() string
type Language ¶
type Language struct {
Dependencies []Dependency `yaml:"dependencies"`
Templates []Template `yaml:"templates"`
}
Language is a per-language implementation of a module: the dependencies it introduces and the templates it renders.
type Manifest ¶
type Manifest struct {
APIVersion string `yaml:"apiVersion"`
Name string `yaml:"name"`
Version string `yaml:"version"`
Summary string `yaml:"summary"`
Tags []string `yaml:"tags"`
Requires []string `yaml:"requires"`
Conflicts []string `yaml:"conflicts"`
// EnvVars describes the environment variables a project needs to
// configure when this module is selected. It does not mean this
// module's own Go code calls os.Getenv directly — none of the shipped
// modules do; secrets and settings are passed as constructor
// parameters instead (e.g. ProviderStripe(secret)). This field exists
// so tooling — the renderer's env var aggregation — can generate an
// accurate .env.example for the generated project, not to describe
// this module's internal implementation.
EnvVars []EnvVar `yaml:"env"`
Languages map[string]Language `yaml:"languages"`
}
Manifest is the decoded, unvalidated form of a module.yaml file.
type Template ¶
Template maps a source template file to a destination path relative to the generated project root.
type ValidationError ¶
type ValidationError struct {
Errors []FieldError
}
ValidationError aggregates every FieldError found while validating a Manifest, rather than stopping at the first one.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string