Documentation ¶
Index ¶
- Constants
- type DBSource
- func (ds *DBSource[T, K]) Delete(key K) error
- func (ds *DBSource[T, K]) GetItem(key K) (item T, err error)
- func (ds *DBSource[T, K]) GetList(params Params) DataList[T]
- func (ds *DBSource[T, K]) Pagination(tx *gorm.DB, pageIndex int, pageSize int, dest interface{}, ...) (meta PageMeta, err error)
- func (ds *DBSource[T, K]) Store(item *T) error
- func (ds *DBSource[T, K]) Update(key K, item *T) error
- type DataList
- type DataSource
- type PageMeta
- type PageParam
- type PagenationDataList
- type Params
- type Scopes
- type SimpleDataList
Constants ¶
View Source
const (
DefaultPageSize = 20
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBSource ¶
type DBSource[T any, K comparable] struct { // contains filtered or unexported fields }
func NewDBDataSource ¶
func NewDBDataSource[T any, K comparable](db *gorm.DB) *DBSource[T, K]
func NewDBDataTableSource ¶
func (*DBSource[T, K]) Pagination ¶
type DataSource ¶
type PagenationDataList ¶
type PagenationDataList interface {
GetPageMeta() PageMeta
}
type SimpleDataList ¶
func NewSimpleDataList ¶
func NewSimpleDataList[T any](items []T) *SimpleDataList[T]
func NewSimpleDataPageList ¶
func NewSimpleDataPageList[T any](items []T, meta PageMeta) *SimpleDataList[T]
func (*SimpleDataList[T]) GetData ¶
func (sd *SimpleDataList[T]) GetData() []T
Click to show internal directories.
Click to hide internal directories.