Documentation ¶
Index ¶
- Constants
- Variables
- func AddFunc(name string, fnFactory func(ctx *FnCtx) (fn TemplateFunc))
- func Map(objs ...interface{}) error
- func MustMap(obj interface{})
- func ScanDir(dirPath string) (e error)
- type Cache
- type Central
- type File
- type Fn
- type FnCtx
- type SQLContent
- type SQLExecutor
- func (e *SQLExecutor) Execute(args []reflect.Value) (results []reflect.Value)
- func (e *SQLExecutor) Insert(args []reflect.Value) (results []reflect.Value)
- func (e *SQLExecutor) Select(args []reflect.Value) (results []reflect.Value)
- func (e *SQLExecutor) SelectCache(args []reflect.Value) (results []reflect.Value)
- type SQLSet
- type TemplateFunc
- type TemplateFuncFactory
Constants ¶
View Source
const ( Dir errorSago = iota // dir error Xml // unmarshal xml error YAML NoDBField NoCacheInManager BadCacheField BadSQLTemplate WrongTypeToMap XMLMappedWrong )
View Source
const ( MethodNameArg = "arg" MethodInArg = "in" )
Variables ¶
View Source
var DefaultManager = New()
View Source
var FileConflict = errors.New("file conflict")
View Source
var ShowSQL = false
Functions ¶
func AddFunc ¶
func AddFunc(name string, fnFactory func(ctx *FnCtx) (fn TemplateFunc))
Types ¶
type Central ¶
type Central struct { Cache Cache // contains filtered or unexported fields }
func (*Central) AddFunc ¶
func (m *Central) AddFunc(name string, fnFactory func(ctx *FnCtx) (fn TemplateFunc))
type File ¶
type File struct { XMLName xml.Name `xml:"sago"` Package string `xml:"package"` Type string `xml:"type"` Table string `xml:"table"` Selects []SQLContent `xml:"select"` Executes []SQLContent `xml:"execute"` Inserts []SQLContent `xml:"insert"` }
type SQLContent ¶
type SQLExecutor ¶
type SQLExecutor struct { Cache Cache Table string FieldsString string Fn Fn Tpl *template.Template DB *sqlx.DB ReturnTypes []reflect.Type // contains filtered or unexported fields }
func NewSQLExecutor ¶
func (*SQLExecutor) Execute ¶
func (e *SQLExecutor) Execute(args []reflect.Value) (results []reflect.Value)
func (*SQLExecutor) Insert ¶
func (e *SQLExecutor) Insert(args []reflect.Value) (results []reflect.Value)
func (*SQLExecutor) Select ¶
func (e *SQLExecutor) Select(args []reflect.Value) (results []reflect.Value)
func (*SQLExecutor) SelectCache ¶
func (e *SQLExecutor) SelectCache(args []reflect.Value) (results []reflect.Value)
type TemplateFunc ¶
type TemplateFuncFactory ¶
type TemplateFuncFactory struct { Name string Create func(ctx *FnCtx) TemplateFunc }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.