doc

package
v0.0.0-...-ccd8cf7 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CamelCase indicates using CamelCase strategy for struct field.
	CamelCase = "camelcase"

	// PascalCase indicates using PascalCase strategy for struct field.
	PascalCase = "pascalcase"

	// SnakeCase indicates using SnakeCase strategy for struct field.
	SnakeCase = "snakecase"
)
View Source
const APIDefinitionName = "api.go"
View Source
const MethodAny = "Any"
View Source
const RouteEntryName = "router.go"

Variables

This section is empty.

Functions

func WithDebug

func WithDebug(debug bool) func(parser *Parser)

func WithExcludedDirsAndFiles

func WithExcludedDirsAndFiles(excludes string) func(*Parser)

func WithPackagesDefinitions

func WithPackagesDefinitions(pkgs *PackagesDefinitions) func(parser *Parser)

func WithWorkDir

func WithWorkDir(cwd string) func(parser *Parser)

Types

type AstFileInfo

type AstFileInfo struct {
	File        *ast.File
	FileSet     *token.FileSet
	Path        string
	PackagePath string
}

type Normalize

type Normalize struct {
	// contains filtered or unexported fields
}

func NewNormalize

func NewNormalize(log log.Logger, wdWithSlash string, debug bool) Normalize

func (Normalize) Check

func (n Normalize) Check() error

type Option

type Option func(pkg *PackagesDefinitions)

func WithExcludes

func WithExcludes(dir map[string]bool) Option

func WithWorkdir

func WithWorkdir(dir string) Option

type PackageDefinitions

type PackageDefinitions struct {
	Name  string
	Files map[string]*ast.File
}

type PackagesDefinitions

type PackagesDefinitions struct {
	// contains filtered or unexported fields
}

func NewPackagesDefinitions

func NewPackagesDefinitions(opt ...Option) *PackagesDefinitions

func (*PackagesDefinitions) CollectAstFile

func (pkgs *PackagesDefinitions) CollectAstFile(packageDir, path string, astFile *ast.File, fset *token.FileSet)

func (*PackagesDefinitions) RangeFileForInjectTag

func (pkgs *PackagesDefinitions) RangeFileForInjectTag(dryRun bool, filepath, propertyStrategy string, tagFlags []string, typeMap map[string]bool, handle func(dryRun bool, propertyStrategy string, tagFlags []string, typeMap map[string]bool, info *AstFileInfo, file *ast.File) error) error

func (*PackagesDefinitions) RangeFiles

func (pkgs *PackagesDefinitions) RangeFiles(handle func(astInfo *AstFileInfo, file *ast.File) error) error

type Parser

type Parser struct {
	Packages *PackagesDefinitions

	ImportPaths          []string
	ImportPathsCache     map[string]bool
	IsHasMiddleware      bool
	TypePackagePathCache []string
	Debug                bool
	Apis                 []string
	ApiMap               map[string]string
	// contains filtered or unexported fields
}

func NewParser

func NewParser(options ...func(*Parser)) *Parser

func (*Parser) ParseAPI

func (p *Parser) ParseAPI(searchDir string) error

func (*Parser) ParseAPIInfo

func (p *Parser) ParseAPIInfo(info *AstFileInfo, astFile *ast.File) error

func (*Parser) ParseCommentInfo

func (p *Parser) ParseCommentInfo(info *AstFileInfo, astFile *ast.File) error

func (*Parser) ParseImportsToMap

func (p *Parser) ParseImportsToMap(importPath string) map[string]string

func (*Parser) ParseTypeSpec

func (p *Parser) ParseTypeSpec(dryRun bool, propertyStrategy string, tagFlags []string, typeMap map[string]bool, info *AstFileInfo, astFile *ast.File) error

func (*Parser) Skip

func (p *Parser) Skip(path string, f os.FileInfo) error

Jump to

Keyboard shortcuts

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