package model
import "github.com/golang/mock/mockgen/model"
Package model contains the data model necessary for generating mock implementations.
Index ¶
- Variables
- type ArrayType
- type ChanDir
- type ChanType
- type FuncType
- type Interface
- func InterfaceFromInterfaceType(it reflect.Type) (*Interface, error)
- func (intf *Interface) AddMethod(m *Method)
- func (intf *Interface) Print(w io.Writer)
- type MapType
- type Method
- type NamedType
- type Package
- type Parameter
- type PointerType
- type PredeclaredType
- type Type
Variables ¶
var ErrorInterface = Interface{ Name: "error", Methods: []*Method{ { Name: "Error", Out: []*Parameter{ { Name: "", Type: PredeclaredType("string"), }, }, }, }, }
ErrorInterface represent built-in error interface.
Types ¶
type ArrayType ¶
ArrayType is an array or slice type.
func (*ArrayType) String ¶
type ChanDir ¶
type ChanDir int
ChanDir is a channel direction.
Constants for channel directions.
type ChanType ¶
ChanType is a channel type.
func (*ChanType) String ¶
type FuncType ¶
FuncType is a function type.
func (*FuncType) String ¶
type Interface ¶
Interface is a Go interface.
func InterfaceFromInterfaceType ¶
InterfaceFromInterfaceType returns a pointer to an interface for the given reflection interface type.
func (*Interface) AddMethod ¶
AddMethod adds a new method, de-duplicating by method name.
func (*Interface) Print ¶
Print writes the interface name and its methods.
type MapType ¶
type MapType struct { Key, Value Type }
MapType is a map type.
func (*MapType) String ¶
type Method ¶
Method is a single method of an interface.
func (*Method) Print ¶
Print writes the method name and its signature.
type NamedType ¶
NamedType is an exported type in a package.
func (*NamedType) String ¶
type Package ¶
Package is a Go package. It may be a subset.
func (*Package) Imports ¶
Imports returns the imports needed by the Package as a set of import paths.
func (*Package) Print ¶
Print writes the package name and its exported interfaces.
type Parameter ¶
Parameter is an argument or return parameter of a method.
func (*Parameter) Print ¶
Print writes a method parameter.
type PointerType ¶
type PointerType struct { Type Type }
PointerType is a pointer to another type.
func (*PointerType) String ¶
func (pt *PointerType) String(pm map[string]string, pkgOverride string) string
type PredeclaredType ¶
type PredeclaredType string
PredeclaredType is a predeclared type such as "int".
func (PredeclaredType) String ¶
func (pt PredeclaredType) String(map[string]string, string) string
type Type ¶
type Type interface { String(pm map[string]string, pkgOverride string) string // contains filtered or unexported methods }
Type is a Go type.
Source Files ¶
- Version
- v1.6.0 (latest)
- Published
- Jun 11, 2021
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 5 days ago –
Tools for package owners.