Documentation ¶
Index ¶
- Variables
- func FuncCall(g *generator.Generator) interface{}
- func FuncCallGRPCAdapter(g *generator.Generator) interface{}
- func FuncGRPCAdapterServer(g *generator.Generator) interface{}
- func FuncMutates(g *generator.Generator) interface{}
- func FuncResults(g *generator.Generator) interface{}
- func FuncReturnErr(g *generator.Generator) interface{}
- func FuncReturnOK(g *generator.Generator) interface{}
- func FuncSignature(g *generator.Generator) interface{}
- type Generator
Constants ¶
This section is empty.
Variables ¶
var (
Templates = map[string]string{
"sqltx": sqltxTemplate,
"trace": traceTemplate,
"grpcadapter": grpcadapterTemplate,
"mutex": mutexTemplate,
}
)
Functions ¶
func FuncCall ¶
FuncCall returns a signature of the function represented by f f can be one of: ast.Expr, ast.SelectorExpr, types.Type, types.Signature
func FuncCallGRPCAdapter ¶
FuncCallGRPCAdapter returns the parameters used to adapt a grpc client call to a grpc server.
func FuncGRPCAdapterServer ¶
FuncGRPCAdapterServer returns the name of the grpc server given the client name.
func FuncMutates ¶
FuncMutates returns a boolean that denotes if a given function mutates things.
func FuncResults ¶
FuncResults returns the slice of results being returned from a function as well as the assignment operator used.
func FuncReturnErr ¶
FuncReturnErr creates a list of results using their nil values excluding the last value if it is an error. This allows users to return a wrapped error, or what ever they so desire.
func FuncReturnOK ¶
FuncReturnOK returns the slice of results from a function where if the last result is an error it is replaced with nil.
func FuncSignature ¶
FuncSignature builds the interface of the method.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator is capable of generating a decorator using its template.
func NewGenerator ¶
NewGenerator returns a new generator.