Documentation ¶
Overview ¶
Package infra mainly treats side effects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeGenerater ¶
type CodeGenerater struct { Renderer domain.TemplateRenderer DirMaker domain.DirMaker FileWriter domain.FileWriter }
CodeGenerater generates code.
func (CodeGenerater) Exec ¶
func (cg CodeGenerater) Exec(dest, cfgTmpl string, config domain.TemplateData) error
Exec generates code with template and configuration.
type OSExecExecuter ¶
type OSExecExecuter struct{}
OSExecExecuter executes command.
func (OSExecExecuter) Exec ¶
func (executer OSExecExecuter) Exec(cmd, dest string) error
Exec executes a command.
type StrFormatter ¶
type StrFormatter struct{}
StrFormatter formats string by commands.
func (StrFormatter) Format ¶
func (formatter StrFormatter) Format(dest, text string, formatters []string, reader domain.FileReader, executer domain.CmdExecuter) (string, error)
Format formats a string by given commands. Write a given string to a temporary file and execute commands to the file and read the file.
type TextTemplateRenderer ¶
type TextTemplateRenderer struct{}
TextTemplateRenderer renders template.
type YAMLCfgReader ¶
type YAMLCfgReader struct{}
YAMLCfgReader is reads the configuration file as YAML.
Click to show internal directories.
Click to hide internal directories.