parser

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Comment string
	Package string
	// Only used to get the middleware type
	FuncType   FuncType
	Imports    []NamedTypeValue
	Constants  []NamedTypeValue
	Vars       []NamedTypeValue
	Interfaces []Interface
	Structures []Struct
	Methods    []Method
}

File represents a go source file.

func NewFile

func NewFile() File

NewFile creates a new empty file.

type FileParser

type FileParser struct{}

FileParser is the parser used by kit to parse go files.

func NewFileParser

func NewFileParser() *FileParser

NewFileParser returns a new parser.

func (*FileParser) Parse

func (fp *FileParser) Parse(src []byte) (*File, error)

Parse will parse the go source.

type FuncType

type FuncType struct {
	Name       string
	Parameters []NamedTypeValue
	Results    []NamedTypeValue
}

FuncType is used to store e.x (type Middleware func(a)a) types

type Interface

type Interface struct {
	Name    string
	Comment string
	Methods []Method
}

Interface stores go interface information.

func NewInterface

func NewInterface(name string, methods []Method) Interface

NewInterface creates a new interface.

type Method

type Method struct {
	Comment    string
	Name       string
	Struct     NamedTypeValue
	Body       string
	Parameters []NamedTypeValue
	Results    []NamedTypeValue
}

Method stores go method information.

func NewMethod

func NewMethod(name string, str NamedTypeValue, body string, parameters, results []NamedTypeValue) Method

NewMethod creates a new method.

type NamedTypeValue

type NamedTypeValue struct {
	Name  string
	Type  string
	Value string
}

NamedTypeValue is used to store any type of name type = value ( e.x var a = 2)

func NewNameType

func NewNameType(name string, tp string) NamedTypeValue

NewNameType create a NamedTypeValue without a value.

func NewNameTypeValue

func NewNameTypeValue(name string, tp string, vl string) NamedTypeValue

NewNameTypeValue create a NamedTypeValue with a value.

type Struct

type Struct struct {
	Name    string
	Comment string
	Vars    []NamedTypeValue
}

Struct stores go struct information.

func NewStruct

func NewStruct(name string, vars []NamedTypeValue) Struct

NewStruct creates a new struct.

Jump to

Keyboard shortcuts

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