Documentation
¶
Index ¶
- Constants
- func Env() (dir, file string, line int, err error)
- func FirstLower(s string) string
- func GetTemplate(in interface{}) string
- func Template(dir, filename string, line int) error
- func TemplateInfoLine(dir, filename string, structName string) (int, string, error)
- func Templater(dir, file string, line int, options ...Option) error
- type Config
- type InfoContext
- type Option
- type TemplateContext
- type ValueType
Constants ¶
View Source
const ( ValueTypeValue = ValueType(iota + 1) ValueTypeFunc )
Variables ¶
This section is empty.
Functions ¶
func FirstLower ¶
func GetTemplate ¶
func GetTemplate(in interface{}) string
func TemplateInfoLine ¶
Types ¶
type Config ¶
type InfoContext ¶
type InfoContext struct {
Tags string
CommentPrefix string
TemplateTags string
Fs *token.FileSet
AstFile *ast.File
Line int
Success bool
WorkingDirectory string
Filename string
File string
TemplatePkg string
TemplatePath string
TemplateStruct string
TemplateFilename string
TemplateLine int
TemplateRandName string
DataPkg string
ProjectPkg string
PackagePath string
ProjectPath string
Package string
IdentName string
ValueType ValueType
IsPtr bool
GeneratedFilename string
ValueGetter string
}
func (InfoContext) PtrStar ¶
func (i InfoContext) PtrStar() string
type Option ¶
func WithConfig ¶
type TemplateContext ¶
type TemplateContext struct {
Fs *token.FileSet
AstFile *ast.File
Success bool
WorkingDirectory string
Filename string
TemplateFilename string
TemplateGoFilename string
File string
Package string
StructName string
}
func TemplateInfo ¶
func TemplateInfo(dir, filename string, line int) (TemplateContext, error)
Click to show internal directories.
Click to hide internal directories.