maingen

package
v1.41.9 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenerateForInternalPackageTests = false

GenerateForInternalPackageTests is set to true when we're running the maingen package tests, to generate code without temporary directories in the file paths (for reproducibility).

Functions

func Gen

func Gen(p GenParams) *config.Static

func GenAppConfig added in v1.25.0

func GenAppConfig(p GenParams, test option.Option[testParams]) *config.Static

Types

type GenParams

type GenParams struct {
	Gen           *codegen.Generator
	Desc          *app.Desc
	MainModule    *pkginfo.Module
	RuntimeModule *pkginfo.Module

	// CompilerVersion is the version of the compiler to embed in the generated code.
	CompilerVersion string
	// AppRevision is the revision of the app to embed in the generated code.
	AppRevision string
	// AppUncommitted tracks whether there were uncommitted changes in the app
	// at the time of build.
	AppUncommitted bool

	APIHandlers    map[*api.Endpoint]*codegen.VarDecl
	AuthHandler    option.Option[*codegen.VarDecl]
	Middleware     map[*middleware.Middleware]*codegen.VarDecl
	ServiceStructs map[*app.Service]*codegen.VarDecl

	// Test contains configuration for generating test code.
	Test option.Option[codegen.TestConfig]

	// ExecScriptMainPkg is the main package to build for an ExecScript execution.
	ExecScriptMainPkg option.Option[paths.Pkg]
}

Jump to

Keyboard shortcuts

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