Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentVisitor ¶ added in v0.0.9
type CommentVisitor struct {
// contains filtered or unexported fields
}
func NewCommentVisitor ¶ added in v0.0.9
func NewCommentVisitor(p string) (*CommentVisitor, error)
func (*CommentVisitor) Targets ¶ added in v0.0.9
func (cv *CommentVisitor) Targets() []string
func (*CommentVisitor) Visit ¶ added in v0.0.9
func (cv *CommentVisitor) Visit(nRaw ast.Node) ast.Visitor
func (*CommentVisitor) Walk ¶ added in v0.0.9
func (cv *CommentVisitor) Walk() error
type GeneratorOpts ¶
type GeneratorOpts struct { // FormatImports, if set to true, will be used // call imports.Process FormatImports bool // Template will be used to generate the wrapper // If this is null TemplateStr or TemplatePath // will be used. Template *template.Template // TemplateStr will be used to generate the wrapper // If this is null Template or TemplatePath // will be used. TemplateStr string // TemplatePath will be used to generate the wrapper // The code will first read the contents. If this is // null Template or TemplateStr will be used. // TODO can this be a directory? TemplatePath string // Suffix will be used to name the generated wrapper. // GOFILE.Suffix.go. By default misura will be used.j Suffix string // Metrics will be used to decided what metrics to include. // Possible values are: // 1. duration // 2. total // 3. error // 4. success // 5. all // If all is specified then others will be ignored. Metrics types.Strings }
TODO how can we go about using multiple template files
type TemplateVals ¶
type TypeVisitor ¶
type TypeVisitor struct {
// contains filtered or unexported fields
}
func NewTypeVisitor ¶
func NewTypeVisitor(g *WrapperGenerator, opts TypeVisitorOpts) (*TypeVisitor, error)
func (*TypeVisitor) Walk ¶
func (t *TypeVisitor) Walk() error
type TypeVisitorOpts ¶
type WrapperGenerator ¶
type WrapperGenerator struct {
// contains filtered or unexported fields
}
func MustNewWrapperGenerator ¶
func MustNewWrapperGenerator(w *WrapperGenerator, err error) *WrapperGenerator
func NewWrapperGenerator ¶
func NewWrapperGenerator(opts GeneratorOpts) (*WrapperGenerator, error)
func (*WrapperGenerator) Generate ¶
func (w *WrapperGenerator) Generate(outPath, filename string, tmplVals TemplateVals) error
Click to show internal directories.
Click to hide internal directories.