Documentation ¶
Index ¶
- Constants
- func NewFunction()
- type Field
- func (f *Field) AddField(field *Field)
- func (f *Field) ContainsMap() bool
- func (f *Field) DbName() string
- func (f *Field) Findable() bool
- func (f *Field) FindableType() string
- func (f *Field) GetPath() string
- func (f *Field) GetTagValue(key string) string
- func (f *Field) SetFields(sf []*Field)
- func (f *Field) String() string
- func (f *Field) ValidFields() []*Field
- type Function
- type Generator
- type Hook
- type HookAction
- type Model
- type Package
- type Processor
- type Template
- type TemplateData
- func (td *TemplateData) CallHooks(whenStr, actionStr string, upsert bool, model *Model) string
- func (td *TemplateData) GenType(vi interface{}, path string) string
- func (td *TemplateData) GenVar(vi interface{}, done map[interface{}]bool) string
- func (td *TemplateData) LinkStruct(path string, vi interface{}) string
- func (td *TemplateData) StructValue(vi interface{}, done map[interface{}]bool) string
- type TemplateField
Constants ¶
View Source
const ( StoreNamePattern = "%sStore" QueryNamePattern = "%sQuery" ResultSetNamePattern = "%sResultSet" )
View Source
const BaseDocument = "github.com/tyba/storable.Document"
Variables ¶
This section is empty.
Functions ¶
func NewFunction ¶
func NewFunction()
Types ¶
type Field ¶
type Field struct { Name string Type string CheckedNode *types.Var Tag reflect.StructTag Fields []*Field Parent *Field Hooks []Hook // contains filtered or unexported fields }
func (*Field) ContainsMap ¶
func (*Field) FindableType ¶
func (*Field) GetTagValue ¶
func (*Field) ValidFields ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
type Hook ¶ added in v0.2.0
type Hook struct { Before bool Action HookAction }
func (Hook) MethodName ¶ added in v0.2.0
type HookAction ¶ added in v0.2.0
type HookAction string
const ( InsertHook HookAction = "Insert" UpdateHook HookAction = "Update" SaveHook HookAction = "Save" )
type Model ¶
type Model struct { Name string StoreName string QueryName string ResultSetName string Collection string Type string Fields []*Field CheckedNode *types.Named NewFunc *types.Func Package *types.Package Hooks []Hook StoreHooks []Hook }
func (*Model) NewArgVars ¶
func (*Model) NewRetVars ¶
func (*Model) NewReturns ¶
func (*Model) ValidFields ¶
type TemplateData ¶
type TemplateData struct { *Package Fields []*TemplateField Processed map[interface{}]string }
func (*TemplateData) CallHooks ¶ added in v0.2.0
func (td *TemplateData) CallHooks(whenStr, actionStr string, upsert bool, model *Model) string
func (*TemplateData) GenType ¶
func (td *TemplateData) GenType(vi interface{}, path string) string
func (*TemplateData) GenVar ¶
func (td *TemplateData) GenVar(vi interface{}, done map[interface{}]bool) string
func (*TemplateData) LinkStruct ¶
func (td *TemplateData) LinkStruct(path string, vi interface{}) string
func (*TemplateData) StructValue ¶
func (td *TemplateData) StructValue(vi interface{}, done map[interface{}]bool) string
type TemplateField ¶
func (*TemplateField) ValidFields ¶
func (tf *TemplateField) ValidFields() []*Field
Click to show internal directories.
Click to hide internal directories.