Documentation ¶
Index ¶
- func Create(cfg CreateConfig) error
- func Generate(config *Config, provider provider) error
- type Config
- type CreateConfig
- type Generator
- func (g *Generator) ExtractTemplateFrom(filename string) (*template.Template, error)
- func (g *Generator) Generate() error
- func (g *Generator) ProcessFiles(files []manifest.File) error
- func (g *Generator) RenderOutputPath(f manifest.File) (string, error)
- func (g *Generator) RunShell(rawSh string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶ added in v0.2.0
func Create(cfg CreateConfig) error
Types ¶
type Config ¶
type Config struct { WorkingDirectory string ProjectAuthor string ProjectName string ProjectPackage string Manifest *manifest.Manifest OptionalSteps []string ManifestPath string }
Config contains all information required to generate project.
type CreateConfig ¶ added in v0.2.0
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator couples generation task and file provider into unite context to create project.
func NewGenerator ¶
func (*Generator) ExtractTemplateFrom ¶
ExtractTemplateFrom reads plain text from specified file and tries to parse it as text/template syntax.
func (*Generator) Generate ¶
Generate traverses steps in project template manifest and performs actions defined inside each of them.
func (*Generator) RenderOutputPath ¶
RenderOutputPath renders output path for passed file from raw output path template.
Click to show internal directories.
Click to hide internal directories.