codegen

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package codegen emits reflection-free configbind apply, flag, and env key tables.

Index

Constants

View Source
const (
	FieldString      = codegen.FieldString
	FieldBool        = codegen.FieldBool
	FieldInt         = codegen.FieldInt
	FieldStringSlice = codegen.FieldStringSlice
	FieldStruct      = codegen.FieldStruct

	// ScaffoldTOMLName and ScaffoldEnvName are the exported constant names
	// emitted into the package containing Bind calls.
	ScaffoldTOMLName = "ConfigbindScaffoldTOML"
	ScaffoldEnvName  = "ConfigbindScaffoldEnv"
)

Variables

This section is empty.

Functions

func Generate

func Generate(packageName string, specs []Spec) ([]byte, error)

Generate emits package source that registers Meta and Apply for each Spec.

func GenerateScaffolds added in v0.1.10

func GenerateScaffolds(specs []Spec) (tomlText, envText string, err error)

GenerateScaffolds builds TOML and .env sample text from Bind struct metadata. It does not write files or generate an application command; callers may print the emitted constants from a command appropriate for their application.

Types

type Field

type Field = codegen.Field

Field and FieldKind re-export for callers.

type FieldKind

type FieldKind = codegen.FieldKind

Field and FieldKind re-export for callers.

type Spec

type Spec = codegen.Spec

Spec is a Bind-style struct with prefix for generation. Reuses minitoml/codegen field shapes.

Jump to

Keyboard shortcuts

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