Documentation ¶
Index ¶
- func AbsPath(p string) (string, error)
- func NewTestModelInterfaceSlice(startIndex int, count int) []interface{}
- func NewTestParentInterfaceSlice(startIndex int, count int, withChildren bool) []interface{}
- func TestBackend(skipFlag *bool, backendBuilder func() (db.Backend, apperror.Error))
- func WriteFile(p string, content []byte, createDir bool) error
- type File
- type HooksModel
- func (h *HooksModel) AfterCreate(Backend)
- func (h *HooksModel) AfterDelete(Backend)
- func (h *HooksModel) AfterQuery(Backend)
- func (h *HooksModel) AfterUpdate(Backend)
- func (h *HooksModel) BeforeCreate(Backend) error
- func (h *HooksModel) BeforeDelete(Backend) error
- func (h *HooksModel) BeforeUpdate(Backend) error
- func (h *HooksModel) Validate() error
- type MarshalledData
- type MarshalledModel
- type Project
- type Tag
- type Task
- type TestModel
- type TestParent
- type ValidationsModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestBackend ¶
Types ¶
type HooksModel ¶
func (*HooksModel) AfterCreate ¶
func (h *HooksModel) AfterCreate(Backend)
func (*HooksModel) AfterDelete ¶
func (h *HooksModel) AfterDelete(Backend)
func (*HooksModel) AfterQuery ¶
func (h *HooksModel) AfterQuery(Backend)
func (*HooksModel) AfterUpdate ¶
func (h *HooksModel) AfterUpdate(Backend)
func (*HooksModel) BeforeCreate ¶
func (h *HooksModel) BeforeCreate(Backend) error
func (*HooksModel) BeforeDelete ¶
func (h *HooksModel) BeforeDelete(Backend) error
func (*HooksModel) BeforeUpdate ¶
func (h *HooksModel) BeforeUpdate(Backend) error
func (*HooksModel) Validate ¶
func (h *HooksModel) Validate() error
type MarshalledData ¶
type MarshalledModel ¶
type MarshalledModel struct { Id uint64 MapVal map[string]interface{} `db:"marshal"` StructVal MarshalledData `db:"marshal"` StructPtrVal *MarshalledData `db:"marshal"` }
type Task ¶
type Task struct { Id uint64 Name string `db:"required"` Description string Priority int // has-one with struct. Project Project ProjectId uint64 // has-one with struct pointer. Project2 *Project Project2Id *Project // belongs-to with struct. File *File // m2m with struct slice. Tags []Tag `db:"m2m"` // contains filtered or unexported fields }
type TestModel ¶
type TestModel struct { Id uint64 // For inferred belongs-to TestParentId uint64 `db:"ignore-zero"` // For explicit has-one/belongs-to MyParent *TestParent `db:"has-one:MyParentId:Id"` MyParentId uint64 `db:"ignore-zero"` StrVal string IntVal int64 }
func NewTestModel ¶
func NewTestModelPtrSlice ¶
func NewTestModelSlice ¶
type TestParent ¶
type TestParent struct { TestModel Child TestModel `db:"has-one:ChildId:Id;auto-persist;"` ChildId uint64 ChildPtr *TestModel `db:"belongs-to:Id:Id;auto-persist;"` ChildSlice []TestModel ChildSlice2 []TestModel `db:"belongs-to:Id:MyParentId"` ChildSlicePtr []*TestModel `db:"m2m"` }
func NewTestParent ¶
func NewTestParent(index int, withChildren bool) TestParent
func NewTestParentPtrSlice ¶
func NewTestParentPtrSlice(startIndex int, count int, withChildren bool) []*TestParent
func NewTestParentSlice ¶
func NewTestParentSlice(startIndex int, count int, withChildren bool) []TestParent
type ValidationsModel ¶
type ValidationsModel struct { TestModel NotNullString string `db:"required"` NotNullInt int `db:"required"` ValidatedString string `db:"min:5;max:10"` ValidatedInt int `db:"min:5;max:10"` }
func (*ValidationsModel) Collection ¶
func (m *ValidationsModel) Collection() string
Click to show internal directories.
Click to hide internal directories.