types

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

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

func Extract

func Extract(importPaths []string, targetNames []string) ([]*Interface, error)

func (*Interface) Method

func (i *Interface) Method(name string) *Method

func (*Interface) MethodNames

func (i *Interface) MethodNames() []string

type InterfaceType

type InterfaceType int
const (
	InterfaceTypeStruct InterfaceType = iota
	InterfaceTypeInterface
)

type Method

type Method struct {
	Name     string
	Params   []types.Type
	Results  []types.Type
	Variadic bool
}

type Package

type Package struct {
	Name  string
	Types map[string]*Interface
}

func NewPackage

func NewPackage(name string, types map[string]*Interface) *Package

type Packages

type Packages struct {
	// contains filtered or unexported fields
}

func NewPackages

func NewPackages(packages map[string]*Package) *Packages

func (*Packages) GetInterface

func (p *Packages) GetInterface(name string) (*Interface, error)

func (*Packages) GetNames

func (p *Packages) GetNames() []string

Jump to

Keyboard shortcuts

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