astconfig

package
v3.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package astconfig reads gothic.config.go via go/parser (no type checker) and produces the same cli.Config struct that v2 loaded from gothic-config.json.

The parser only understands static composite literals: string literals, integer literals, nested struct literals, map literals, and the three ENV builder calls (gothic.Env, gothic.SSMParam, gothic.SecretsManager). Any unrecognized top-level field or non-literal expression (e.g. os.Getenv(...)) is silently ignored. The only hard error is an unknown ENV builder function.

GoModName is NOT read from gothic.config.go; it is read from go.mod in projectRoot via golang.org/x/mod/modfile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateOrchestrator

func GenerateOrchestrator(projectRoot, hookName string, gctx *config.GothicContext) (*config.GothicContext, error)

GenerateOrchestrator compiles and runs the user's lifecycle hook (hookName, e.g. "BeforeDeploy" or "AfterDeploy") from gothic.config.go in an isolated temporary module, passing the GothicContext as JSON over the GOTHIC_CONTEXT env var and reading back the (possibly mutated) context from stdout.

The temporary module imports the user's config file as package "gothicorchestrator" and links it against the gothicframework module via a replace directive pointing at the framework module root on disk (resolved by findFrameworkRoot).

func HasHook

func HasHook(projectRoot, hookName string) (bool, error)

HasHook reports whether gothic.config.go declares a top-level function with the given name (e.g. "BeforeDeploy", "AfterDeploy").

func Parse

func Parse(projectRoot string) (*cli.Config, error)

Parse reads gothic.config.go from projectRoot and returns the parsed config.

Types

This section is empty.

Jump to

Keyboard shortcuts

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