Documentation
¶
Index ¶
- Variables
- func AddGlobal(gf genny.File, globals ...string) (genny.File, error)
- 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 GoFiles(dir string) ([]string, error)
- func ReplaceBlock(gf genny.File, open, close, newOpen, newClose string) (genny.File, 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 ¶
This section is empty.
Variables ¶
View Source
var TemplateHelpers = map[string]interface{}{}
Functions ¶
func AddInsideBlock ¶
AddInsideBlock will add anything inside of the app declaration block inside of file
func FmtTransformer ¶
func FmtTransformer() genny.Transformer
func ReplaceBlock ¶ added in v2.0.14
ReplaceBlock replaces found block with given new open/close statements
open - start statement of the block e.g. `if isTrue {`
close - close statement of the block e.g. `}`
newOpen - new start statement of the block e.g. `defer func(isTrue) {`
newClose - new close statement of the block e.g. `}()`
func ReplaceBlockBody ¶
ReplaceBlockBody will replace found block body 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 ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.