service

package
v0.0.0-...-527e48b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	// contains filtered or unexported fields
}

Task defines the application service in charge of interacting with Tasks.

func NewTask

func NewTask(logger *zap.Logger, repo TaskRepository, search TaskSearchRepository, msgBroker TaskMessageBrokerRepository) *Task

NewTask ...

func (*Task) By

By searches Tasks matching the received values.

func (*Task) Create

func (t *Task) Create(ctx context.Context, params internal.CreateParams) (internal.Task, error)

Create stores a new record.

func (*Task) Delete

func (t *Task) Delete(ctx context.Context, id string) error

Delete removes an existing Task from the datastore.

func (*Task) Task

func (t *Task) Task(ctx context.Context, id string) (internal.Task, error)

Task gets an existing Task from the datastore.

func (*Task) Update

func (t *Task) Update(ctx context.Context, id string, description string, priority internal.Priority, dates internal.Dates, isDone bool) error

Update updates an existing Task in the datastore. nolint: lll

type TaskMessageBrokerRepository

type TaskMessageBrokerRepository interface {
	Created(ctx context.Context, task internal.Task) error
	Deleted(ctx context.Context, id string) error
	Updated(ctx context.Context, task internal.Task) error
}

TaskMessageBrokerRepository defines the datastore handling persisting Searchable Task records.

type TaskRepository

type TaskRepository interface {
	Create(ctx context.Context, dates internal.CreateParams) (internal.Task, error)
	Delete(ctx context.Context, id string) error
	Find(ctx context.Context, id string) (internal.Task, error)
	Update(ctx context.Context, id string, description string, priority internal.Priority, dates internal.Dates, isDone bool) error
}

TaskRepository defines the datastore handling persisting Task records.

type TaskSearchRepository

type TaskSearchRepository interface {
	Search(ctx context.Context, args internal.SearchParams) (internal.SearchResults, error)
}

TaskSearchRepository defines the datastore handling searching Task records.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL