Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manifest ¶
type Manifest struct {
JSON struct {
ScanTypeMap string `json:"scanTypeMap"`
PerRun []string `json:"perRun"`
PerTable []string `json:"perTable"`
PerStmtXML []string `json:"perStmtXML"`
}
ScanTypeMap ScanTypeMap
PerRun [][2]*template.Template // [nameTmpl, contentTmpl]
PerTable [][2]*template.Template
PerStmtXML [][2]*template.Template
// contains filtered or unexported fields
}
Manifest contains file and template information.
func LoadManifest ¶
LoadManifest loads file and templates from a manifest in a directory.
type Option ¶
Option is used to create Renderer.
func OutputPkg ¶
OutputPkg sets an alternative package name for the generated code. By default the output directory is used.
func TmplDir ¶
func TmplDir(tmplDir http.FileSystem) Option
TmplDir sets the template directory. (required)
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer is used to render templates to final source code.
func NewRenderer ¶
NewRenderer creates a new Renderer.
type ScanTypeMap ¶
ScanTypeMap maps data type to scan type. [0] is for not nullable types. [1] is for nullable types.
func LoadScanTypeMap ¶
func LoadScanTypeMap(r io.Reader) (ScanTypeMap, error)
LoadScanTypeMap loads scan type map from io.Reader.
func (ScanTypeMap) NotNullScanType ¶
func (m ScanTypeMap) NotNullScanType(col interface{}) (string, error)
NotNullScanType returns the not nullable scan type for the (table or query result) column.
func (ScanTypeMap) NullScanType ¶
func (m ScanTypeMap) NullScanType(col interface{}) (string, error)
NullScanType returns the nullable scan type for the (table or query result) column.
func (ScanTypeMap) ScanType ¶
func (m ScanTypeMap) ScanType(col interface{}) (string, error)
ScanType returns the scan type for the (table or query result) column.