22 lines
545 B
Go
22 lines
545 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.ksdemosapps.com/kylesoda/pgx-learning/internal/models"
|
|
)
|
|
|
|
type GetAllTaskFilters struct {
|
|
Limit int
|
|
Offset int
|
|
Completed *bool
|
|
}
|
|
|
|
type TaskRepository interface {
|
|
Save(ctx context.Context, task *models.Task) error
|
|
GetById(ctx context.Context, id int) (*models.Task, error)
|
|
GetAll(ctx context.Context, filters GetAllTaskFilters) ([]models.Task, error)
|
|
Update(ctx context.Context, id int, input *models.UpdateTaskInput) (*models.Task, error)
|
|
Delete(ctx context.Context, id int) error
|
|
}
|