parser

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateImplementation

func GenerateImplementation(args ImplementationArgs) (string, error)

Types

type ImplementationArgs

type ImplementationArgs struct {
	ReceiverName       string
	StructName         string
	ReceiverStructName string
	FunctionName       string
	FunctionParams     string
	FunctionReturns    []string
	FunctionCallArgs   []string
	MockFunctionName   string
}

func (*ImplementationArgs) FormatReturnValues

func (args *ImplementationArgs) FormatReturnValues() string

type ImportInfo

type ImportInfo struct {
	Alias       string
	PackagePath string
}

type Info

type Info struct {
	Imports            map[string]ImportInfo
	Implementations    []string
	MockFunctions      []string
	StructName         string
	ReceiverStructName string
}

type Parser

type Parser struct {
	Imports map[string]ImportInfo
	// contains filtered or unexported fields
}

func NewParser

func NewParser() *Parser

func (*Parser) ExtractGenericConstraints

func (p *Parser) ExtractGenericConstraints(t types.Type) ([]string, []string, error)

func (*Parser) ExtractParameters

func (p *Parser) ExtractParameters(signature *types.Signature) ([]string, []string, error)

func (*Parser) ExtractResults

func (p *Parser) ExtractResults(signature *types.Signature) ([]string, error)

func (*Parser) FindAndParseInterface

func (p *Parser) FindAndParseInterface(packagePath string, interfaceName string) (*Info, error)

func (*Parser) TypeExtracter

func (p *Parser) TypeExtracter(ut types.Type, variadic bool) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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