Documentation
¶
Overview ¶
Package generator writes the Go models of a dbspec document set; the orm-gen command and other programs call it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check generates the models like Generate without changing OutputDir or its parent directory and returns one line for each generated file that differs, is missing, or is extra, ordered by path.
func Generate ¶
Generate writes the Go models of the runtime model to OutputDir. The generated files of OutputDir are replaced after the scan converges; any other error leaves OutputDir unchanged. A *ScannedSourceError reports scanned packages that do not compile with the complete models written to OutputDir.
Types ¶
type Options ¶
type Options struct {
// Model is the runtime model of a dbspec document set.
Model *runtimemodel.Model
OutputDir string
// PackageName selects the Go package name; the directory name by default.
PackageName string
// Scan lists the Go package patterns whose model calls are generated.
Scan []string
}
Options describes one deterministic Go generation request.
type ScannedSourceError ¶
type ScannedSourceError struct {
Errors []string
}
ScannedSourceError reports scanned packages that do not compile with the generated models. The output directory holds the complete generated models when generation returns it.
func (*ScannedSourceError) Error ¶
func (e *ScannedSourceError) Error() string