Documentation ¶
Index ¶
- type Task
- type TaskRepository
- func (r *TaskRepository) AddTask(ctx context.Context, description string, createdAt time.Time) (*datastore.Key, error)
- func (r *TaskRepository) DeleteTask(ctx context.Context, taskID int64) error
- func (r *TaskRepository) FilterKey(ctx context.Context, key *datastore.Key) ([]*entity.Task, error)
- func (r *TaskRepository) ListTasks(ctx context.Context) ([]*entity.Task, error)
- func (r *TaskRepository) MarkDone(ctx context.Context, taskID int64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct { ID *datastore.Key `datastore:"__key__"` Description string Text string Done bool Due time.Time `datastore:",omitempty"` CreatedAt time.Time Metadata metadata }
Task is the model used to store tasks in the datastore.
type TaskRepository ¶
type TaskRepository struct {
// contains filtered or unexported fields
}
TaskRepository is task repository.
func NewTaskRepository ¶
func NewTaskRepository(client *datastore.Client) *TaskRepository
NewTaskRepository returns task repository.
func (*TaskRepository) AddTask ¶
func (r *TaskRepository) AddTask(ctx context.Context, description string, createdAt time.Time) (*datastore.Key, error)
AddTask adds a task with the given description to the datastore, returning the key of the newly created entity.
func (*TaskRepository) DeleteTask ¶
func (r *TaskRepository) DeleteTask(ctx context.Context, taskID int64) error
DeleteTask deletes the task with the given ID.
Click to show internal directories.
Click to hide internal directories.