Documentation
¶
Overview ¶
Package registry is the catalogue of modules platformgo knows how to wire in.
For every module it holds exactly what the generator needs: package, settings type, dependencies and environment variables. That is why enabling a module needs no code changes: the generator assembles the wiring from this description.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Module ¶
type Module struct {
Name string // section name in platformgo.yaml
Requires []string // modules it cannot work without
Import string // import path of the module package
Package string // package name in code
Field string // field name in the project's Config struct
Env []EnvVar
// ProjectPkg is a package generated inside the project that the module needs at
// startup, given relative to the project module path. Empty for modules that need
// nothing from the project.
ProjectPkg string
ProjectAlias string // name of that import in generated code
ExtraArgs []string // arguments passed to New after the settings
// Compose is the local development service of the module in docker-compose.yml,
// indented as an entry under services. Volumes lists the named volumes it uses.
Compose string
Volumes []string
Tools []Tool
Options []Option // what the module section of platformgo.yaml may contain
}
Module describes a platform module.
func (Module) ConfigType ¶
ConfigType is the settings type of the module, for example postgres.Config.
type Tool ¶ added in v0.2.0
type Tool struct {
Module string // module path, "github.com/sqlc-dev/sqlc"
Package string // what go tool runs, "github.com/sqlc-dev/sqlc/cmd/sqlc"
Version string
}
Tool is a code generator a module needs in the project. It is pinned in the go.mod of the project, so every developer and CI run generate with the same version.
Click to show internal directories.
Click to hide internal directories.