structs

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootStructNameGeneralConfig = "GeneralConfig"
	RootStructNameSecretsConfig = "SecretsConfig"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name,
	Type,
	Doc string

	Embedded bool

	DefaultValue string
}

func NewFieldFromAST

func NewFieldFromAST(ctx context.Context, imports map[string]string, node *ast.Field) Field

type Struct

type Struct struct {
	Name,
	Doc string

	Fields []Field
}

func NewStructFromAST

func NewStructFromAST(ctx context.Context,
	imports map[string]string,
	declarationsNode *ast.GenDecl,
	typeDeclarationNode *ast.TypeSpec,
	structDeclarationNode *ast.StructType,
) *Struct

type Structs

type Structs struct {
	// GeneralConfig and SecretsConfig are called the root structs,
	// corresponding to the general.yaml and secrets.yaml files respectively.
	Roots []*Struct

	All map[string]*Struct
}

func NewStructsFromAST

func NewStructsFromAST(ctx context.Context, imports map[string]string, node ast.Node) *Structs

func (*Structs) ResolveEmbeddedStructFields

func (structs *Structs) ResolveEmbeddedStructFields()

For each struct, we remove the embedded struct fields, and add the corresponding promoted fields.

func (*Structs) Sorted added in v0.20.1

func (structs *Structs) Sorted() []*Struct

Sorted returns all structs sorted alphabetically by name.

Jump to

Keyboard shortcuts

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