reflector

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseInterface added in v0.3.2

func ParseInterface(srcDir, pkgName, ifaceName string) (*ifacetool.Data, error)

func PkgNameFromDir added in v0.3.0

func PkgNameFromDir(dir string) string

func PkgPathFromDir added in v0.3.0

func PkgPathFromDir(dir string) (pkgPath string)

Types

type Interface

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

type InterfaceDoc added in v0.2.6

type InterfaceDoc struct {
	Doc        []string
	MethodDocs map[string][]string
}

func NewInterfaceDoc added in v0.2.6

func NewInterfaceDoc(filename, name string) (*InterfaceDoc, error)

type Method

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

func (*Method) CallParamList

func (m *Method) CallParamList() string

func (*Method) ParamList

func (m *Method) ParamList() string

func (*Method) ResultList

func (m *Method) ResultList() string

type Param

type Param struct {
	Name     string
	Type     string
	RawType  types.Type
	Variadic bool
}

func (Param) CallName

func (p Param) CallName() string

func (Param) String

func (p Param) String() string

func (Param) TypeString

func (p Param) TypeString() string

type Result

type Result struct {
	SrcPkgPrefix string
	SrcPkgName   string
	PkgName      string
	Imports      []string
	Interface    *Interface

	// New-style result data.
	Data *ifacetool.Data
}

func ReflectInterface

func ReflectInterface(srcDir, pkgName, objName string) (*Result, error)

Jump to

Keyboard shortcuts

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