ifacetool

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	PkgName         string
	SrcPkgName      string
	SrcPkgQualifier string
	InterfaceDoc    []string
	InterfaceName   string
	Imports         []*Import
	Methods         []*Method
}

type Import

type Import struct {
	Alias string
	Path  string
}

func (*Import) ImportString

func (i *Import) ImportString() string

type Method

type Method struct {
	Doc     []string
	Name    string
	Params  []*Param
	Returns []*Param
}

func (*Method) ArgList

func (m *Method) ArgList() string

ArgList is the string representation of method parameters, e.g. 's string, n int, foo bar.Baz'.

func (*Method) CallArgList

func (m *Method) CallArgList() string

CallArgList is the string representation of method call parameters, e.g. 's, n, foo'. In case of a last variadic parameter, it will be of the format 's, n, foos...'

func (*Method) ReturnArgNamedValueList

func (m *Method) ReturnArgNamedValueList() string

ReturnArgNamedValueList is the string representation of named return values returned by method, e.g. '(baz bar.Baz)', '(s string, err error)'.

func (*Method) ReturnArgTypeList

func (m *Method) ReturnArgTypeList() string

ReturnArgTypeList is the string representation of types returned by method, e.g. 'bar.Baz', '(string, error)'.

func (*Method) ReturnArgValueList

func (m *Method) ReturnArgValueList() string

ReturnArgValueList is the string representation of values returned by method, e.g. 'foo', 's, err'.

type Param

type Param struct {
	Name       string
	TypeString string
	Type       types.Type `json:"-"`
	Variadic   bool
}

func (*Param) CallName

func (p *Param) CallName() string

CallName returns the string representation of the parameter to be used for a method call. For a variadic parameter, it will be of the format 'foos...'.

func (*Param) MethodArg

func (p *Param) MethodArg() string

MethodArg is the representation of the parameter in the function signature, e.g. 'name a.Type'.

type Parser

type Parser interface {
	Parse(string) (*Data, error)
}

Directories

Path Synopsis
moq

Jump to

Keyboard shortcuts

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