Documentation
¶
Overview ¶
Package genutil is a utility package for query helpers codegeneration.
Index ¶
- func Implementations(pkg *packages.Package, iface *types.Interface) []*types.Named
- func Load(ctx context.Context, pattern string) (*packages.Package, error)
- func PrintType(typ types.Type) string
- func WriteTemplate(source fs.FS, out io.Writer, name string, data interface{}) error
- type Func
- type Interfaces
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Implementations ¶
Implementations finds iface implementations.
Types ¶
type Func ¶
Func is a function representation.
func Funcs ¶
Funcs collects all function from package using given filter. Parameter keep may be nil.
func (Func) ReceiverNamed ¶
ReceiverNamed reports whether f is a method whose receiver's declared type has the provided name. Both value and pointer receivers are supported.
type Interfaces ¶
type Interfaces struct {
// contains filtered or unexported fields
}
Interfaces is a simple utility struct to find interfaces and implementations.
func NewInterfaces ¶
func NewInterfaces(pkg *packages.Package) *Interfaces
NewInterfaces creates new Interfaces structure.
func (*Interfaces) Implementations ¶
func (c *Interfaces) Implementations(name string) ([]*types.Named, error)
Implementations finds interface implementations by interface name.
Click to show internal directories.
Click to hide internal directories.