Documentation ¶
Index ¶
- func FileExists(file string) bool
- type DefaultTemplate
- func (t *DefaultTemplate) Execute(data interface{}) (*bytes.Buffer, error)
- func (t *DefaultTemplate) Funcs(f template.FuncMap) *DefaultTemplate
- func (t *DefaultTemplate) GoFmt(format bool) *DefaultTemplate
- func (t *DefaultTemplate) Parse(text string) *DefaultTemplate
- func (t *DefaultTemplate) SaveTo(data interface{}, path string, forceUpdate bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
Types ¶
type DefaultTemplate ¶
type DefaultTemplate struct {
// contains filtered or unexported fields
}
DefaultTemplate is a tool to provides the text/template operations
func (*DefaultTemplate) Execute ¶
func (t *DefaultTemplate) Execute(data interface{}) (*bytes.Buffer, error)
Execute returns the codes after the template executed
func (*DefaultTemplate) Funcs ¶
func (t *DefaultTemplate) Funcs(f template.FuncMap) *DefaultTemplate
func (*DefaultTemplate) GoFmt ¶
func (t *DefaultTemplate) GoFmt(format bool) *DefaultTemplate
GoFmt sets the value to goFmt and marks the generated codes will be formatted or not
func (*DefaultTemplate) Parse ¶
func (t *DefaultTemplate) Parse(text string) *DefaultTemplate
Parse accepts a source template and returns DefaultTemplate
Click to show internal directories.
Click to hide internal directories.