parse

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedAST = errors.New("unexpected AST")
	ErrSpec          = errors.New("specification error")
)
View Source
var ErrRegexMismatch = errors.New("regex mismatch")

Functions

This section is empty.

Types

type Directive

type Directive interface{}

Directive indicates how to handle a given target field on a struct.

type Function

type Function struct {
	Name       string
	Parameters []Parameter
	Result     string
}

type IgnoreDirective

type IgnoreDirective struct {
	Target Target
}

type JuryrigSpec

type JuryrigSpec struct {
	Package string
	Mappers []Mapper
}

func Read

func Read(filename string) (JuryrigSpec, error)

Read parses Go source into Mapper definitions.

type LinkDirective

type LinkDirective struct {
	Source Source
	Target Target
}

type LinkFuncDirective

type LinkFuncDirective struct {
	Sources      []Source
	FunctionName string
	Target       Target
}

type Mapper

type Mapper struct {
	Name            string
	MapperFunctions []MapperFunction
}

type MapperFunction

type MapperFunction struct {
	Function   Function
	Directives []Directive
}

type Parameter

type Parameter struct {
	Name string
	Type string
}

type Source

type Source struct {
	Parameter string
	// Optional
	Field string
}

type Target

type Target struct {
	Field string
}

Jump to

Keyboard shortcuts

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