Documentation ¶
Index ¶
- func LoadInterfaces(ctx context.Context, srcPkg, srcPkgAlias string, names []string) ([]*Import, []*Interface, error)
- type FSTemplateFetcher
- type HTTPTemplateFetcher
- type Import
- type Interface
- type Method
- type MultiTemplateFetcher
- type Package
- type Parameter
- type TemplateFetcher
- type Type
- type TypeArray
- type TypeBuiltin
- type TypeChan
- type TypeExported
- type TypeFunc
- type TypeMap
- type TypePointer
- type TypeVariadic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FSTemplateFetcher ¶
FSTemplateFetcher treats any given path as existing on the file system and attempts to open the file.
func (*FSTemplateFetcher) FetchTemplate ¶
FetchTemplate attempts to load from the file system.
type HTTPTemplateFetcher ¶
HTTPTemplateFetcher treats any given path as a URL and attempts to download the content via a GET.
func (*HTTPTemplateFetcher) FetchTemplate ¶
FetchTemplate attempts to load via GET.
type Interface ¶
type Interface struct { SrcType Type // e.g. srcPkgAlias.ExportedType Name string Methods []*Method }
Interface is an exported interface defined in a package.
type MultiTemplateFetcher ¶
type MultiTemplateFetcher []TemplateFetcher
MultiTemplateFetcher takes an ordered set of TemplateFetcher instances an attempts to call each one until a response if received or all fail.
func (MultiTemplateFetcher) FetchTemplate ¶
type Package ¶
type Package struct { Name string Source *Import Interfaces []*Interface Imports []*Import // ImportsWithSource will contain Source if the destination package is set and // Source is not included in Imports. ImportsWithSource []*Import }
Package is a container for all exported interfaces of a Go package.
type TemplateFetcher ¶
TemplateFetcher is used to load a template from some source.
type Type ¶
type Type interface {
String() string
}
Type is a Go type definition that can be rendered into a valid Go code snippet.
type TypeBuiltin ¶
type TypeBuiltin string
TypeBuiltin is a built in Go type such as "string" or "bool".
func (TypeBuiltin) String ¶
func (t TypeBuiltin) String() string
type TypeExported ¶
TypeExported is a user defined type that is exported from a package.
func (*TypeExported) String ¶
func (t *TypeExported) String() string
type TypePointer ¶
type TypePointer struct {
Type Type
}
TypePointer is a pointer to another type.
func (*TypePointer) String ¶
func (t *TypePointer) String() string
type TypeVariadic ¶
type TypeVariadic struct {
Type Type
}
TypeVariadic is any type that is prefixed by Ellipsis.
func (*TypeVariadic) String ¶
func (t *TypeVariadic) String() string