package gogen
import "github.com/gobuffalo/gogen"
Index ¶
- Constants
- Variables
- func AddImport(gf genny.File, imports ...string) (genny.File, error)
- func AddInsideBlock(gf genny.File, search string, expressions ...string) (genny.File, error)
- func Append(gf genny.File, expressions ...string) (genny.File, error)
- func Fmt(root string) (*genny.Generator, error)
- func FmtTransformer() genny.Transformer
- func Get(pkg string, args ...string) *exec.Cmd
- func GoFiles(dir string) ([]string, error)
- func Install(pkg string, args ...string) genny.RunFn
- func PackageName(f genny.File) (string, error)
- func ReplaceBlockBody(gf genny.File, search string, expressions ...string) (genny.File, error)
- func RewriteImports(gf genny.File, swaps map[string]string) (genny.File, error)
- func TemplateTransformer(data interface{}, helpers map[string]interface{}) genny.Transformer
- type ParsedFile
Constants ¶
const Version = "v0.2.0"
Version of gogen
Variables ¶
var TemplateHelpers = map[string]interface{}{}
Functions ¶
func AddImport ¶
AddImport adds n number of import statements into the path provided
func AddInsideBlock ¶
AddInsideBlock will add anything inside of the app declaration block inside of file
func Append ¶
Append allows to append source into a go file
func Fmt ¶
func FmtTransformer ¶
func FmtTransformer() genny.Transformer
func Get ¶
func GoFiles ¶
func Install ¶
func PackageName ¶
func ReplaceBlockBody ¶
ReplaceBlockBody will replace found block with expressions passed
func RewriteImports ¶
func TemplateTransformer ¶
func TemplateTransformer(data interface{}, helpers map[string]interface{}) genny.Transformer
TemplateTransformer will run any file that has a ".tmpl" extension through text/template
Types ¶
type ParsedFile ¶
func ParseFile ¶
func ParseFile(gf genny.File) (ParsedFile, error)
func ParseFileMode ¶
Source 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
Directories ¶
Path | Synopsis |
---|---|
goimports | |
gomods | |
packrd | You can use the "packr2 clean" command to clean up this, and any other packr generated files. |
- Version
- v0.2.0 (latest)
- Published
- Jun 14, 2019
- Platform
- js/wasm
- Imports
- 18 packages
- Last checked
- 2 weeks ago –
Tools for package owners.