Documentation
¶
Overview ¶
Package project loads chgen project configuration and runs generation for all declared packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run generates every package declared in the configuration file at configPath. Validation and generation do not change an output. A commit writes and syncs a complete temporary file before it calls os.Rename. The replacement keeps the os.Rename semantics of the host platform. A cross-directory, multi-file commit cannot be one atomic operation, so an I/O failure during commit can replace an earlier output while a later output stays unchanged.
Types ¶
type Config ¶
type Config struct {
Path string
Version int
Packages []PackageConfig
}
Config is the parsed chgen.yaml file. All paths are resolved against the directory that holds the configuration file.
func LoadConfig ¶
LoadConfig reads and validates a chgen.yaml file. Relative paths in the file resolve against the directory that holds the file.
type InputEntry ¶
InputEntry is one queries or schema input as written in the configuration file. Entry keeps the original text for error messages; Path is the entry resolved against the configuration file directory.
type PackageConfig ¶
type PackageConfig struct {
Name string
Output string
Queries []InputEntry
Schema []InputEntry
}
PackageConfig is one generation unit from the configuration file.