Documentation ¶
Index ¶
- func WithDialect[T model](dialect goqu.DialectWrapper) func(*DataServices[T])
- type DataServices
- func (ds *DataServices[T]) Create(ctx context.Context, m T) (T, error)
- func (ds *DataServices[T]) Delete(ctx context.Context, id interface{}) error
- func (ds *DataServices[T]) GetByID(ctx context.Context, id interface{}) (T, error)
- func (ds *DataServices[T]) GetDBx() *sqlx.DB
- func (ds *DataServices[T]) GetDialect() goqu.DialectWrapper
- func (ds *DataServices[T]) GetList(ctx context.Context) ([]T, error)
- func (ds *DataServices[T]) Update(ctx context.Context, id interface{}, updating T) (T, error)
- func (ds *DataServices[T]) UpdateColumns(ctx context.Context, id interface{}, record goqu.Record) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithDialect ¶
func WithDialect[T model](dialect goqu.DialectWrapper) func(*DataServices[T])
Types ¶
type DataServices ¶
type DataServices[T model] struct {
// contains filtered or unexported fields
}
func NewDataServices ¶
func NewDataServices[T model](db *sqlx.DB, options ...func(*DataServices[T])) DataServices[T]
func (*DataServices[T]) Create ¶
func (ds *DataServices[T]) Create(ctx context.Context, m T) (T, error)
func (*DataServices[T]) Delete ¶
func (ds *DataServices[T]) Delete(ctx context.Context, id interface{}) error
func (*DataServices[T]) GetByID ¶
func (ds *DataServices[T]) GetByID(ctx context.Context, id interface{}) (T, error)
func (*DataServices[T]) GetDBx ¶ added in v0.1.2
func (ds *DataServices[T]) GetDBx() *sqlx.DB
func (*DataServices[T]) GetDialect ¶ added in v0.1.1
func (ds *DataServices[T]) GetDialect() goqu.DialectWrapper
func (*DataServices[T]) GetList ¶
func (ds *DataServices[T]) GetList(ctx context.Context) ([]T, error)
func (*DataServices[T]) Update ¶
func (ds *DataServices[T]) Update(ctx context.Context, id interface{}, updating T) (T, error)
func (*DataServices[T]) UpdateColumns ¶
func (ds *DataServices[T]) UpdateColumns(ctx context.Context, id interface{}, record goqu.Record) error
Click to show internal directories.
Click to hide internal directories.