genny: Index | Files | Directories

package gogen

import ""


Package Files

add_import.go add_inside_block.go append.go files.go fmt.go parsed_file.go replace_block_body.go rewrite_import.go templates.go


var TemplateHelpers = map[string]interface{}{}

func AddImport Uses

func AddImport(gf genny.File, imports ...string) (genny.File, error)

AddImport adds n number of import statements into the path provided

func AddInsideBlock Uses

func AddInsideBlock(gf genny.File, search string, expressions ...string) (genny.File, error)

AddInsideBlock will add anything inside of the app declaration block inside of file

func Append Uses

func Append(gf genny.File, expressions ...string) (genny.File, error)

Append allows to append source into a go file

func Fmt Uses

func Fmt(root string) (*genny.Generator, error)

func FmtTransformer Uses

func FmtTransformer() genny.Transformer

func GoFiles Uses

func GoFiles(dir string) ([]string, error)

func ReplaceBlockBody Uses

func ReplaceBlockBody(gf genny.File, search string, expressions ...string) (genny.File, error)

ReplaceBlockBody will replace found block with expressions passed

func RewriteImports Uses

func RewriteImports(gf genny.File, swaps map[string]string) (genny.File, error)

func TemplateTransformer Uses

func TemplateTransformer(data interface{}, helpers map[string]interface{}) genny.Transformer

TemplateTransformer will run any file that has a ".tmpl" extension through text/template

type ParsedFile Uses

type ParsedFile struct {
    File    genny.File
    FileSet *token.FileSet
    Ast     *ast.File
    Lines   []string

func ParseFile Uses

func ParseFile(gf genny.File) (ParsedFile, error)

func ParseFileMode Uses

func ParseFileMode(gf genny.File, mode parser.Mode) (ParsedFile, error)



Package gogen imports 16 packages (graph) and is imported by 42 packages. Updated 2019-12-24. Refresh now. Tools for package owners.