parse

package
v0.0.0-...-fbd1831 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrExpectedOnePackage is returned when multiple packages are found for the
	// provided directory location
	ErrExpectedOnePackage = errors.New("expected to find one package")
)

Functions

This section is empty.

Types

type Field

type Field struct {
	Name string
	Type string
	Tags map[string]string
}

Field represents a field in a struct which have a name and function option name to be used

type Func

type Func struct {
	Name string
}

Func represntes function definition

type Package

type Package struct {
	Name  string
	Types map[string]Type
}

Package contains the packages name and the types relevant for generating against

func Parse

func Parse(dir string) (pkg Package, err error)

Parse parses a director, expecting to find a single package It returns a Go representation of the package with the minimal information required for generating options code

type Type

type Type struct {
	Name   string
	Fields []Field
	Funcs  []Func
}

Type represents a struct type with a name and some associated fields

Jump to

Keyboard shortcuts

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