generator

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2022 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterpreterTemplateParams

type InterpreterTemplateParams struct {
	Package           string
	NameSelector      string
	Name              string
	Schema            schema.Schema
	IDPropertyName    string
	ValuePropertyName string
	Imports           map[string]string
	Dependencies      []parser.Dependency
}

type Struct

type Struct struct {
	Name            string
	InterpreterPath string
	Schema          schema.Schema
	Dependencies    []parser.Dependency
}

func GenerateInterpreter

func GenerateInterpreter(
	parseCtx *parser.Context,
	str *ast.StructType,
	pkg string,
	name string,
	comments []*ast.Comment,
) ([]byte, *Struct, error)

GenerateInterpreter generates an interpreter for the given block

func ParseEmbeddedField

func ParseEmbeddedField(
	parseCtx *parser.Context,
	pkg string,
	astField *ast.Field,
) (*Struct, error)

func ParseStruct

func ParseStruct(
	parseCtx *parser.Context,
	str *ast.StructType,
	pkg string,
	name string,
	metadata *parser.Metadata,
) (*Struct, error)

ParseStruct parses all fields of a given go struct

Jump to

Keyboard shortcuts

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