expr

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const FilePrefix = "_expr_gen.go"

FilePrefix is the prefix used for generated files.

View Source
const GenerateComment = "// Code generated by generate-expr. DO NOT EDIT."

GenerateComment is the comment indicating that the file is generated.

View Source
const HelperFile = "utils_expr_gen.go"

HelperFile holds helpers used for ToExpr conversion.

View Source
const TestFilePrefix = "_expr_gen_test.go"

TestFilePrefix is the prefix used for generated test files.

View Source
const TestHelperFile = "utils_expr_gen_test.go"

TestHelperFile holds helpers used for tests.

View Source
const TestHelpers = `` /* 2208-byte string literal not displayed */

TestHelpers holds the content of the utils_expr_gen_test.go file.

View Source
const UnitTestTemplate = `` /* 367-byte string literal not displayed */

UnitTestTemplate is the template for generating the ToExpr conversion helper unit test for a struct.

View Source
const UtilHelpers = `` /* 466-byte string literal not displayed */

UtilHelpers holds the content of the utils_expr_gen.go file.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(localPkg string, pkgs []*packages.Package, aliases map[string]string) (*Parser, error)

NewParser creates a new code parser.

func (*Parser) CopyStruct

func (p *Parser) CopyStruct(structName, targetFilePrefix string) error

CopyStruct copies the given struct and all sub-structs if necessary, and creating converter functions.

type Struct

type Struct struct {
	Type       *types.TypeName
	Pkg        *types.Package
	Underlying *types.Struct
}

type StructResult

type StructResult struct {
	Struct *Struct
	Decl   *ast.GenDecl
}

Jump to

Keyboard shortcuts

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