Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArgType ¶
type ArgType struct { // DSN is the database string (ie, pgsql://user@blah:localhost:5432/dbname?args=) DSN string `arg:"positional,required,help:data source name"` // Out is the output path. Out string `arg:"-o,help:output path"` // TemplatePath is the path to use the user supplied templates instead of // the built in versions. TemplatePath string `arg:"--template-path,help:user supplied template path"` // BlackList is ignore table names BlackList []string `arg:"--black-list,help:ignore table names"` // Path is output path Path string `arg:"-"` // Package is output package name Package string `arg:"-"` // XoPath is generated path by xo XoPath string `arg:"-"` // XoPackage is generated package by xo XoPackage string `arg:"-"` // Loader is the load model. Loader *Loader `arg:"-"` // Generated is the generated templates after a run. Generated []TBuf `arg:"-"` // contains filtered or unexported fields }
ArgType is the type that specifies the command line arguments.
func (*ArgType) ExecuteTemplate ¶
func (a *ArgType) ExecuteTemplate(tt TemplateType, et EditableType, name string, obj interface{}) error
ExecuteTemplate loads and parses the supplied template with name and executes it with obj as the context.
func (*ArgType) NewTemplateFuncs ¶
NewTemplateFuncs returns a set of template funcs bound to the supplied args.
func (*ArgType) TemplateLoader ¶
TemplateLoader loads templates from the specified name.
func (*ArgType) TemplateSet ¶
func (a *ArgType) TemplateSet() *TemplateSet
TemplateSet retrieves the created template set.
type EditableType ¶
type EditableType bool
Editable
const ( FileEditableType EditableType = true FileNotEditableType EditableType = false )
type TBuf ¶
type TBuf struct { TemplateType TemplateType EditableType EditableType Name string Subname string Buf *bytes.Buffer }
TBuf is to hold the executed templates.
type TemplateSet ¶
type TemplateSet struct {
// contains filtered or unexported fields
}
TemplateSet is a set of templates.
type TemplateType ¶
type TemplateType uint
TemplateType represents a template type.
const ( StructTemplate TemplateType = iota FuncTemplate )
the order here will be the alter the output order per file.
func (TemplateType) String ¶
func (tt TemplateType) String() string
String returns the name for the associated template type.
Click to show internal directories.
Click to hide internal directories.