processor

package
v0.0.0-...-dc97279 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAnnotation

func ParseAnnotation(text string, list AnnotationList) error

func ParseAnnotationList

func ParseAnnotationList(comments *ast.CommentGroup, list AnnotationList) error

Types

type Annotation

type Annotation struct {
	Name   string
	Params map[string]string
}

type AnnotationList

type AnnotationList = map[string]*Annotation

type File

type File struct {
	Name          string
	FileSet       *token.FileSet
	AstFile       *ast.File
	StructList    []*Struct
	InterfaceList []*Interface
	FuncList      []*Func
}

func (*File) AppendFunc

func (f *File) AppendFunc(i *Func)

func (*File) AppendInterface

func (f *File) AppendInterface(i *Interface)

func (*File) AppendStruct

func (f *File) AppendStruct(i *Struct)

func (*File) FindFunction

func (f *File) FindFunction(annotations ...string) []*Func

func (*File) FindInterface

func (f *File) FindInterface(annotations ...string) []*Interface

func (*File) FindStruct

func (f *File) FindStruct(annotations ...string) []*Struct

func (*File) Size

func (f *File) Size() int

type Func

type Func struct {
	Decl *ast.FuncDecl
	*TypeA
}

type Interface

type Interface struct {
	Decl *ast.InterfaceType
	*TypeA
}

type Parser

type Parser struct {
	Filter func(fs.FileInfo) bool
	FSet   *token.FileSet
	Path   string
}

func NewParser

func NewParser(path string) *Parser

func NewParserFilter

func NewParserFilter(path string, filter func(info fs.FileInfo) bool) *Parser

func (*Parser) Exec

func (p *Parser) Exec() (*Result, error)

func (*Parser) FindAnnotation

func (p *Parser) FindAnnotation(file string, Package *ast.Package, result *Result) error

func (*Parser) ParseFuncDecl

func (p *Parser) ParseFuncDecl(decl *ast.FuncDecl, file *File) error

func (*Parser) ParseGenDecl

func (p *Parser) ParseGenDecl(decl *ast.GenDecl, file *File) error

func (*Parser) ParseTypeSpec

func (p *Parser) ParseTypeSpec(spec *ast.TypeSpec, list AnnotationList, file *File)

type Result

type Result struct {
	Files []*File
}

type Struct

type Struct struct {
	Decl *ast.StructType
	*TypeA
}

type TypeA

type TypeA struct {
	Name        string
	Annotations AnnotationList
}

func (*TypeA) Get

func (t *TypeA) Get(name string) *Annotation

Jump to

Keyboard shortcuts

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