mock: github.com/golang/mock/mockgen/model Index | Files

package model

import "github.com/golang/mock/mockgen/model"

Package model contains the data model necessary for generating mock implementations.

Index

Package Files

model.go

type ArrayType Uses

type ArrayType struct {
    Len  int // -1 for slices, >= 0 for arrays
    Type Type
}

ArrayType is an array or slice type.

func (*ArrayType) String Uses

func (at *ArrayType) String(pm map[string]string, pkgOverride string) string

type ChanDir Uses

type ChanDir int

ChanDir is a channel direction.

const (
    RecvDir ChanDir = 1
    SendDir ChanDir = 2
)

type ChanType Uses

type ChanType struct {
    Dir  ChanDir // 0, 1 or 2
    Type Type
}

ChanType is a channel type.

func (*ChanType) String Uses

func (ct *ChanType) String(pm map[string]string, pkgOverride string) string

type FuncType Uses

type FuncType struct {
    In, Out  []*Parameter
    Variadic *Parameter // may be nil
}

FuncType is a function type.

func (*FuncType) String Uses

func (ft *FuncType) String(pm map[string]string, pkgOverride string) string

type Interface Uses

type Interface struct {
    Name    string
    Methods []*Method
}

Interface is a Go interface.

func InterfaceFromInterfaceType Uses

func InterfaceFromInterfaceType(it reflect.Type) (*Interface, error)

func (*Interface) Print Uses

func (intf *Interface) Print(w io.Writer)

type MapType Uses

type MapType struct {
    Key, Value Type
}

MapType is a map type.

func (*MapType) String Uses

func (mt *MapType) String(pm map[string]string, pkgOverride string) string

type Method Uses

type Method struct {
    Name     string
    In, Out  []*Parameter
    Variadic *Parameter // may be nil
}

Method is a single method of an interface.

func (*Method) Print Uses

func (m *Method) Print(w io.Writer)

type NamedType Uses

type NamedType struct {
    Package string // may be empty
    Type    string // TODO: should this be typed Type?
}

NamedType is an exported type in a package.

func (*NamedType) String Uses

func (nt *NamedType) String(pm map[string]string, pkgOverride string) string

type Package Uses

type Package struct {
    Name       string
    Interfaces []*Interface
    DotImports []string
}

Package is a Go package. It may be a subset.

func (*Package) Imports Uses

func (pkg *Package) Imports() map[string]bool

Imports returns the imports needed by the Package as a set of import paths.

func (*Package) Print Uses

func (pkg *Package) Print(w io.Writer)

type Parameter Uses

type Parameter struct {
    Name string // may be empty
    Type Type
}

Parameter is an argument or return parameter of a method.

func (*Parameter) Print Uses

func (p *Parameter) Print(w io.Writer)

type PointerType Uses

type PointerType struct {
    Type Type
}

PointerType is a pointer to another type.

func (*PointerType) String Uses

func (pt *PointerType) String(pm map[string]string, pkgOverride string) string

type PredeclaredType Uses

type PredeclaredType string

PredeclaredType is a predeclared type such as "int".

func (PredeclaredType) String Uses

func (pt PredeclaredType) String(pm map[string]string, pkgOverride string) string

type Type Uses

type Type interface {
    String(pm map[string]string, pkgOverride string) string
    // contains filtered or unexported methods
}

Type is a Go type.

Package model imports 5 packages (graph) and is imported by 17 packages. Updated 2019-03-30. Refresh now. Tools for package owners.