scanner

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseEnum

func ParseEnum(doc string) (string, bool)

func ParseStringFormat

func ParseStringFormat(doc string) (string, string)

func ParseType

func ParseType(typeExpr ast.Expr) (keyType, pkgName string, pointer bool)

func RetrievePackageName

func RetrievePackageName(path string) string

func StringifyCommentGroup

func StringifyCommentGroup(commentGroupList ...*ast.CommentGroup) (comments string)

Types

type ByCommentPos

type ByCommentPos []*ast.CommentGroup

func (ByCommentPos) Len

func (a ByCommentPos) Len() int

func (ByCommentPos) Less

func (a ByCommentPos) Less(i, j int) bool

func (ByCommentPos) Swap

func (a ByCommentPos) Swap(i, j int)

type CommentScanner

type CommentScanner struct {
	CommentMap ast.CommentMap
	// contains filtered or unexported fields
}

func NewCommentScanner

func NewCommentScanner(fileSet *token.FileSet, file *ast.File) *CommentScanner

func (*CommentScanner) CommentGroupListOf

func (scanner *CommentScanner) CommentGroupListOf(targetNode ast.Node) (commentGroupList []*ast.CommentGroup)

func (*CommentScanner) CommentsOf

func (scanner *CommentScanner) CommentsOf(targetNode ast.Node) string

type EnumScanner

type EnumScanner struct {
	Enums map[string]api.Enum
}

func NewEnumScanner

func NewEnumScanner() *EnumScanner

func (*EnumScanner) Enum

func (s *EnumScanner) Enum(typeFullName string) api.Enum

func (*EnumScanner) HasOffset

func (s *EnumScanner) HasOffset(typeFullName string) bool

type ModelScanner

type ModelScanner struct {
	Api *api.Api
	*EnumScanner
	// contains filtered or unexported fields
}

func NewModelScanner

func NewModelScanner(enum *EnumScanner) *ModelScanner

func (*ModelScanner) GetModel

func (m *ModelScanner) GetModel(name string, pkgID string) *api.OperatorModel

func (*ModelScanner) GetModelByID

func (m *ModelScanner) GetModelByID(id string) *api.OperatorModel

func (*ModelScanner) NewInspector

func (m *ModelScanner) NewInspector(pkg *packages.Package) func(node ast.Node) bool

func (*ModelScanner) NewModel

func (m *ModelScanner) NewModel(name string, pkgID string) *api.OperatorModel

func (*ModelScanner) RegisterModel

func (m *ModelScanner) RegisterModel(model *api.OperatorModel)

func (*ModelScanner) ResolveStdType

func (m *ModelScanner) ResolveStdType(typeName, pkgPath string) *api.OperatorModel

type OperatorScanner

type OperatorScanner struct {
	Api *api.Api
	// contains filtered or unexported fields
}

func NewOperatorScanner

func NewOperatorScanner(modelScanner *ModelScanner) *OperatorScanner

func (*OperatorScanner) AddOrphanMethod

func (v *OperatorScanner) AddOrphanMethod(method *api.OperatorMethod, groupName string)

func (*OperatorScanner) NewInspector

func (v *OperatorScanner) NewInspector(pkg *packages.Package) func(node ast.Node) bool

func (*OperatorScanner) ResolveOrphanMethod

func (v *OperatorScanner) ResolveOrphanMethod(groupName string) error

Jump to

Keyboard shortcuts

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