internal

package
v3.0.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoConfigFile         = fmt.Errorf("no config file exists")
	ErrNoGoFilesFoundInRoot = fmt.Errorf("no go files found in root search path")
	ErrPkgNotFound          = fmt.Errorf("package not found in config")
	ErrGoModNotFound        = fmt.Errorf("no go.mod file found")
	ErrGoModInvalid         = fmt.Errorf("go.mod file has no module line")
)

Functions

This section is empty.

Types

type Formatter

type Formatter string
const (
	FormatGofmt     Formatter = "gofmt"
	FormatGoImports Formatter = "goimports"
	FormatNoop      Formatter = "noop"
)

type NodeVisitor

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

func NewNodeVisitor

func NewNodeVisitor(ctx context.Context) *NodeVisitor

func (*NodeVisitor) DeclaredInterfaces

func (nv *NodeVisitor) DeclaredInterfaces() []string

func (*NodeVisitor) Visit

func (nv *NodeVisitor) Visit(node ast.Node) ast.Visitor

type Parser

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

func NewParser

func NewParser(buildTags []string) *Parser

func (*Parser) ParsePackages

func (p *Parser) ParsePackages(ctx context.Context, packageNames []string) ([]*config.Interface, error)

type TemplateGenerator

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

func NewTemplateGenerator

func NewTemplateGenerator(
	ctx context.Context,
	srcPkg *packages.Package,
	outPkgFSPath *pathlib.Path,
	templateName string,
	formatter Formatter,
	pkgConfig *config.Config,
	pkgName string,
) (*TemplateGenerator, error)

func (*TemplateGenerator) Generate

func (g *TemplateGenerator) Generate(
	ctx context.Context,
	interfaces []*config.Interface,
) ([]byte, error)

Jump to

Keyboard shortcuts

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