Documentation ¶
Index ¶
- func BuildDBError(err error, methodName string) error
- type Attribute
- func (repo *Attribute) BuildConditionParams(q *model.AttributeQuery) (condition string, params []interface{})
- func (repo *Attribute) FindAll() ([]model.Attribute, error)
- func (repo *Attribute) FindAllFull() ([]model.Attribute, error)
- func (repo *Attribute) FindAllFullByEntity(q *model.AttributeQuery, entityID int) ([]model.Attribute, error)
- func (repo *Attribute) FindByID(id int) (model.Attribute, error)
- func (repo *Attribute) FindFullByID(id int) (model.Attribute, error)
- type Base
- type Entity
- func (repo *Entity) BuildConditionParams(q *model.EntityQuery) (condition string, params []interface{})
- func (repo *Entity) FindAll() ([]model.Entity, error)
- func (repo *Entity) FindAllFull(q *model.EntityQuery) ([]model.Entity, error)
- func (repo *Entity) FindBaseByIDs(m interface{}, ids []int) error
- func (repo *Entity) FindByID(id int) (model.Entity, error)
- func (repo *Entity) FindFullByID(id int) (model.Entity, error)
- type Repository
- func (repo *Repository) Delete(m Base) error
- func (repo *Repository) FindAllWithPreload(attribute interface{}) error
- func (repo *Repository) FindBaseByID(m interface{}, id int) error
- func (repo *Repository) GetOffsetLimit(page int, pageSize int) (offset int, limit int)
- func (repo *Repository) Store(m Base) (int, error)
- func (repo *Repository) Update(m Base) (int, error)
- type SQLHandler
- func (h *SQLHandler) Find(attribute interface{}) error
- func (h *SQLHandler) FindAllByConditionWithPreload(attribute interface{}, c string, p []interface{}, offset int, limit int) error
- func (h *SQLHandler) FindAllWithPreloadAndJoin(attribute interface{}, c string, p []interface{}, offset int, limit int, ...) error
- func (h *SQLHandler) FindByAttribute(m interface{}, q interface{}) error
- func (h *SQLHandler) FindByConditionWithPreload(attribute interface{}, c string, p []interface{}) error
- func (h *SQLHandler) FindWithPreload(attribute interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDBError ¶
Types ¶
type Attribute ¶
type Attribute struct {
*Repository
}
func (*Attribute) BuildConditionParams ¶
func (repo *Attribute) BuildConditionParams(q *model.AttributeQuery) (condition string, params []interface{})
func (*Attribute) FindAllFull ¶
FindAll
func (*Attribute) FindAllFullByEntity ¶
func (repo *Attribute) FindAllFullByEntity(q *model.AttributeQuery, entityID int) ([]model.Attribute, error)
FindAllFullByEntity
type Entity ¶
type Entity struct {
*Repository
}
func (*Entity) BuildConditionParams ¶
func (repo *Entity) BuildConditionParams(q *model.EntityQuery) (condition string, params []interface{})
BuildConditionParams build condition deleted_at is NULL
func (*Entity) FindAllFull ¶
FindAllFull
func (*Entity) FindBaseByIDs ¶
type Repository ¶
type Repository struct {
*SQLHandler
}
func New ¶
func New() *Repository
func (*Repository) FindAllWithPreload ¶
func (repo *Repository) FindAllWithPreload(attribute interface{}) error
FindAll
func (*Repository) FindBaseByID ¶
func (repo *Repository) FindBaseByID(m interface{}, id int) error
FindBaseByID
func (*Repository) GetOffsetLimit ¶
func (repo *Repository) GetOffsetLimit(page int, pageSize int) (offset int, limit int)
GetOffset
type SQLHandler ¶
type SQLHandler struct {
// contains filtered or unexported fields
}
func NewSQLHandler ¶
func NewSQLHandler() *SQLHandler
func (*SQLHandler) Find ¶
func (h *SQLHandler) Find(attribute interface{}) error
func (*SQLHandler) FindAllByConditionWithPreload ¶
func (h *SQLHandler) FindAllByConditionWithPreload(attribute interface{}, c string, p []interface{}, offset int, limit int) error
func (*SQLHandler) FindAllWithPreloadAndJoin ¶
func (*SQLHandler) FindByAttribute ¶
func (h *SQLHandler) FindByAttribute(m interface{}, q interface{}) error
func (*SQLHandler) FindByConditionWithPreload ¶
func (h *SQLHandler) FindByConditionWithPreload(attribute interface{}, c string, p []interface{}) error
FindByConditionWithPreload with preload
func (*SQLHandler) FindWithPreload ¶
func (h *SQLHandler) FindWithPreload(attribute interface{}) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.