Documentation ¶
Index ¶
- func ClassifyLangFiles(fpaths []string) (map[string][]LanguageTplFile, error)
- func Glob(dir string, ext string) ([]string, error)
- func MustJSONMarshal(v interface{}) string
- type FileHandler
- type LanguageTplFile
- type NameSegment
- type TemplateTool
- func (t *TemplateTool) Execute(w io.Writer, name string, obj interface{}) error
- func (t *TemplateTool) ExecuteCached(w io.Writer, name string, obj interface{}) error
- func (t *TemplateTool) ExecuteRawString(w io.Writer, rawTpl string, obj interface{}) error
- func (t *TemplateTool) ExecuteRawStringToString(rawTpl string, obj interface{}) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClassifyLangFiles ¶
func ClassifyLangFiles(fpaths []string) (map[string][]LanguageTplFile, error)
ClassifyLangFiles ...
Types ¶
type FileHandler ¶
type FileHandler struct {
// contains filtered or unexported fields
}
FileHandler ...
func NewFileHandler ¶
func NewFileHandler(fileHook langhook.FileHook) *FileHandler
NewFileHandler ...
type LanguageTplFile ¶
type LanguageTplFile struct { NS *NameSegment FilePath string }
LanguageTplFile language file
type NameSegment ¶
type NameSegment struct { DirPath string FileName string TemplateType string // 0 means all ObjectCount int FileExt string }
NameSegment segment for filename
func ParseNameSegment ¶
func ParseNameSegment(fpath string) (*NameSegment, error)
ParseNameSegment parse NameSegment from dir/fname
type TemplateTool ¶
type TemplateTool struct {
// contains filtered or unexported fields
}
Tool helper for
func NewTemplateTool ¶
func NewTemplateTool(templateDir string, funcMap template.FuncMap) *TemplateTool
NewTool new tool for template
func (*TemplateTool) Execute ¶
func (t *TemplateTool) Execute(w io.Writer, name string, obj interface{}) error
func (*TemplateTool) ExecuteCached ¶
func (t *TemplateTool) ExecuteCached(w io.Writer, name string, obj interface{}) error
ExecuteCached executes a specified template in the template set using the supplied obj as its parameters and writing the output to w.
func (*TemplateTool) ExecuteRawString ¶
func (t *TemplateTool) ExecuteRawString(w io.Writer, rawTpl string, obj interface{}) error
func (*TemplateTool) ExecuteRawStringToString ¶
func (t *TemplateTool) ExecuteRawStringToString(rawTpl string, obj interface{}) (string, error)
Click to show internal directories.
Click to hide internal directories.