genny: github.com/gobuffalo/genny/gogen Index | Files | Directories

package gogen

import "github.com/gobuffalo/genny/gogen"

Index

Package Files

add_import.go add_inside_block.go append.go files.go fmt.go get.go package.go parsed_file.go replace_block_body.go rewrite_import.go templates.go version.go

Constants

const Version = "v0.2.0"

Version of gogen

Variables

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 Get Uses

func Get(pkg string, args ...string) *exec.Cmd

func GoFiles Uses

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

func Install Uses

func Install(pkg string, args ...string) genny.RunFn

func PackageName Uses

func PackageName(f genny.File) (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)

Directories

PathSynopsis
goimports
gomods

Package gogen imports 18 packages (graph) and is imported by 30 packages. Updated 2019-09-19. Refresh now. Tools for package owners.