project

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 17 Imported by: 0

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

func Run(configPath string) error

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

func LoadConfig(path string) (*Config, error)

LoadConfig reads and validates a chgen.yaml file. Relative paths in the file resolve against the directory that holds the file.

type InputEntry

type InputEntry struct {
	Entry string
	Path  string
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL