Documentation
¶
Index ¶
- Variables
- type Iterator
- type Model
- type ModelOperator
- func (m *ModelOperator[T]) Create(ctx context.Context) (rowsAffected int64, err error)
- func (m *ModelOperator[T]) Delete(ctx context.Context) (rowsAffected int64, err error)
- func (m *ModelOperator[T]) List(ctx context.Context, limit, offset int, order ...any) ([]*T, int64, error)
- func (m *ModelOperator[T]) Load(ctx context.Context) error
- func (m *ModelOperator[T]) Model() Model
- func (m *ModelOperator[T]) Update(ctx context.Context) (rowsAffected int64, err error)
- type Repository
- type UnimplementedRepository
- func (rep *UnimplementedRepository[T]) Count(ctx context.Context, where any) (int64, error)
- func (rep *UnimplementedRepository[T]) Delete(ctx context.Context, where any) (int64, error)
- func (rep *UnimplementedRepository[T]) FindOne(ctx context.Context, where any) (*T, error)
- func (rep *UnimplementedRepository[T]) Insert(ctx context.Context, data any) (int64, error)
- func (rep *UnimplementedRepository[T]) Iterate(ctx context.Context, column string, where any) (Iterator[T], error)
- func (rep *UnimplementedRepository[T]) List(ctx context.Context, where any, offset, limit int, order ...any) ([]*T, int64, error)
- func (rep *UnimplementedRepository[T]) Update(ctx context.Context, where any, update any) (int64, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnimplemented = errors.New("not implemented")
Functions ¶
This section is empty.
Types ¶
type ModelOperator ¶
type ModelOperator[T any] struct { Rep Repository[T] Value *T }
func NewModelOperator ¶
func NewModelOperator[T any](rep Repository[T], value *T) *ModelOperator[T]
func (*ModelOperator[T]) Create ¶
func (m *ModelOperator[T]) Create(ctx context.Context) (rowsAffected int64, err error)
func (*ModelOperator[T]) Delete ¶
func (m *ModelOperator[T]) Delete(ctx context.Context) (rowsAffected int64, err error)
func (*ModelOperator[T]) Model ¶
func (m *ModelOperator[T]) Model() Model
type Repository ¶
type Repository[T any] interface { FindOne(ctx context.Context, where any) (*T, error) List(ctx context.Context, where any, offset, limit int, order ...any) ([]*T, int64, error) Count(ctx context.Context, where any) (int64, error) Update(ctx context.Context, where any, update any) (int64, error) Delete(ctx context.Context, where any) (int64, error) Insert(ctx context.Context, data any) (int64, error) Iterate(ctx context.Context, column string, where any) (Iterator[T], error) }
type UnimplementedRepository ¶
type UnimplementedRepository[T any] struct{}
func (*UnimplementedRepository[T]) FindOne ¶
func (rep *UnimplementedRepository[T]) FindOne(ctx context.Context, where any) (*T, error)
Click to show internal directories.
Click to hide internal directories.