mockgen

package
v0.0.0-...-bb63f74 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterfaceTypeNotFound = errors.New("interface type not found")

Functions

func WriteMockType

func WriteMockType(interfaceName string, typeData *TypeData) string

Types

type Method

type Method struct {
	Name        string
	Params      []Type
	ReturnTypes []Type
}

func (Method) ParamNames

func (method Method) ParamNames() []string

func (Method) ParamsWithTypes

func (method Method) ParamsWithTypes() string

func (Method) ReturnTypesAsString

func (method Method) ReturnTypesAsString() string

type Type

type Type struct {
	PackageName, TypeName, Name string
}

func (Type) FullTypeName

func (t Type) FullTypeName() string

type TypeData

type TypeData struct {
	PackageName        string
	Imports            []*ast.ImportSpec
	Methods            []Method
	EmbeddedInterfaces []string
}

func GetMethodsForType

func GetMethodsForType(sourceCode, interfaceName string) (*TypeData, error)

Jump to

Keyboard shortcuts

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