Documentation ¶
Index ¶
- func DBDelete(db *sql.DB, table string, where string, args ...interface{}) (uint64, error)
- func DBGetRow(db *sql.DB, sql string, args ...interface{}) (map[string]interface{}, error)
- func DBGetRows(db *sql.DB, sql string, args ...interface{}) ([]map[string]interface{}, error)
- func DBInsert(db *sql.DB, table string, row map[string]interface{}) (uint64, error)
- func DBScalar(db *sql.DB, sql string, args ...interface{}) (uint64, error)
- func DBUpdate(db *sql.DB, table string, row map[string]interface{}, where string, ...) (uint64, error)
- func IsRecordNotFound(err error) bool
- type Field
- type Filter
- type ListInput
- type ListOutput
- type PagedRows
- type Pagination
- type Record
- type RecordNotFoundError
- type Resource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRecordNotFound ¶
Types ¶
type ListInput ¶
type ListInput struct { Pagination Pagination `json: "pagination"` Filter Filter `json:"filter"` }
type ListOutput ¶
type ListOutput struct { Pagination List []Record `json:"list"` }
type PagedRows ¶
type PagedRows struct { Pagination List []map[string]interface{} `json:"list"` }
type Pagination ¶
type Pagination struct { PageSize uint `json:"page_size"` Page uint `json:"page"` PageTotal uint `json:"page_total"` Total uint `json:"total"` }
func NewPagination ¶
func NewPagination(pageSize, page uint) *Pagination
func (*Pagination) GetOffsetLimit ¶
func (p *Pagination) GetOffsetLimit() (uint, uint)
func (*Pagination) SetTotal ¶
func (p *Pagination) SetTotal(total uint)
func (*Pagination) Valid ¶
func (p *Pagination) Valid()
type RecordNotFoundError ¶
type RecordNotFoundError struct { }
func (RecordNotFoundError) Error ¶
func (e RecordNotFoundError) Error() string
Click to show internal directories.
Click to hide internal directories.