Movatterモバイル変換


[0]ホーム

URL:


model

package
v0.6.0Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License:Apache-2.0Imports:6Imported by:38

Details

Repository

github.com/uber/mock

Links

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

View Source
var ErrorInterface =Interface{Name: "error",Methods: []*Method{{Name: "Error",Out: []*Parameter{{Name: "",Type:PredeclaredType("string"),},},},},}

ErrorInterface represent built-in error interface.

Functions

This section is empty.

Types

typeArrayType

type ArrayType struct {Lenint// -1 for slices, >= 0 for arraysTypeType}

ArrayType is an array or slice type.

func (*ArrayType)String

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

typeChanDir

type ChanDirint

ChanDir is a channel direction.

const (RecvDirChanDir = 1SendDirChanDir = 2)

Constants for channel directions.

typeChanType

type ChanType struct {DirChanDir// 0, 1 or 2TypeType}

ChanType is a channel type.

func (*ChanType)String

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

typeFuncType

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

FuncType is a function type.

func (*FuncType)String

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

typeInterface

type Interface struct {NamestringMethods    []*MethodTypeParams []*Parameter}

Interface is a Go interface.

funcInterfaceFromGoTypesTypeadded inv0.6.0

func InterfaceFromGoTypesType(it *types.Interface) (*Interface,error)

InterfaceFromGoTypesType returns a pointer to an interface for thegiven interface type loaded from archive.

funcInterfaceFromInterfaceType

func InterfaceFromInterfaceType(itreflect.Type) (*Interface,error)

InterfaceFromInterfaceType returns a pointer to an interface for thegiven reflection interface type.

func (*Interface)AddMethod

func (intf *Interface) AddMethod(m *Method)

AddMethod adds a new method, de-duplicating by method name.

func (*Interface)Print

func (intf *Interface) Print(wio.Writer)

Print writes the interface name and its methods.

typeMapType

type MapType struct {Key, ValueType}

MapType is a map type.

func (*MapType)String

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

typeMethod

type Method struct {NamestringIn, Out  []*ParameterVariadic *Parameter// may be nil}

Method is a single method of an interface.

func (*Method)Print

func (m *Method) Print(wio.Writer)

Print writes the method name and its signature.

typeNamedType

type NamedType struct {Packagestring// may be emptyTypestringTypeParams *TypeParametersType}

NamedType is an exported type in a package.

func (*NamedType)String

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

typePackage

type Package struct {NamestringPkgPathstringInterfaces []*InterfaceDotImports []string}

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

func (*Package)Imports

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

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

func (*Package)Print

func (pkg *Package) Print(wio.Writer)

Print writes the package name and its exported interfaces.

typeParameter

type Parameter struct {Namestring// may be emptyTypeType}

Parameter is an argument or return parameter of a method.

func (*Parameter)Print

func (p *Parameter) Print(wio.Writer)

Print writes a method parameter.

typePointerType

type PointerType struct {TypeType}

PointerType is a pointer to another type.

func (*PointerType)String

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

typePredeclaredType

type PredeclaredTypestring

PredeclaredType is a predeclared type such as "int".

func (PredeclaredType)String

typeType

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

Type is a Go type.

typeTypeParametersType

type TypeParametersType struct {TypeParameters []Type}

TypeParametersType contains type parameters for a NamedType.

func (*TypeParametersType)String

func (tp *TypeParametersType) String(pm map[string]string, pkgOverridestring)string

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp