parser

package
v1.1.0 Latest Latest
Warning

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

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

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