Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixImports ¶
FixImports will fix and formattion any missing error in the generated code
func GenerateTracerFileName ¶
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector is the first entry door of this logic. To start generated code we need to instantiate this collector with NewCollector. Then fill the filename that this Collector need to read
func (*Collector) FindInterface ¶
func (c *Collector) FindInterface(name string) (*InterfaceType, error)
FindInterface will return InterfaceType that can be transformed by transformer
type Func ¶
Func is struct that used to store data that can be used into Generate function.
func (*Func) FixEmptyParams ¶
func (f *Func) FixEmptyParams()
FixEmptyParams will set empty params names and set it with arg0 arg1 and so on..
type FuncText ¶
type FuncText struct { Func ReceiverText string ParamsText string ReturnText string ParamsNames string }
FuncText is struct that will be used as input to be used in func template and struct template
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator will generate code with input Proxy
func NewGenerator ¶
func NewGenerator() *Generator
NewGenerator will instatiate Generator that have FuncGenerator and StructGenerator
type InterfaceType ¶
type InterfaceType struct { Name string PackageName string Ast *ast.InterfaceType }
type MultiVar ¶
type MultiVar []Var
MultiVar is list of Var. Ussually used in Params and Returns And ussually used in function body
type Proxy ¶
Proxy is struct that store data that can be used to generate Struct and its function
func (*Proxy) SetBaseType ¶
SetBaseType will set it BaseType and its functions BaseType
func (*Proxy) SetRecieverTypeSuffix ¶
SetRecieverTypeSuffix will set receiver for functions and struct
type StructMethods ¶
func FindStructMethods ¶
func FindStructMethods(path string, structName string) (StructMethods, error)