Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotImplemented indicates a missing feature from the application ErrNotImplemented = errors.New("feature not implemented") // ErrEntityNotFound indicates a specific entity could not be found ErrEntityNotFound = errors.New("entity not found") // ErrInvalidRequest means a request is either nil or not appropriate for the requested action ErrInvalidRequest = errors.New("request is invalid") )
Functions ¶
This section is empty.
Types ¶
type Task ¶
type Task struct { gorm.Model `json:"-"` ID string `json:"id"` Title string `json:"title"` Description string `json:"description"` IsDone bool `json:"is_done"` CreatedAt time.Time `json:"created_at"` }
Task that needs to be accomplished
type TaskHttpService ¶
type TaskHttpService interface { Create(w http.ResponseWriter, r *http.Request) Update(w http.ResponseWriter, r *http.Request) MarkDone(w http.ResponseWriter, r *http.Request) MarkPending(w http.ResponseWriter, r *http.Request) List(w http.ResponseWriter, r *http.Request) ListDone(w http.ResponseWriter, r *http.Request) ListPending(w http.ResponseWriter, r *http.Request) }
TaskHttpService exposes TaskService over an http interface
type TaskRepo ¶
type TaskRepo interface { Create(ctx context.Context, task Task) error Get(ctx context.Context, id string) (*Task, error) List(ctx context.Context) ([]Task, error) Update(ctx context.Context, task Task) error }
TaskRepo allows persistence of tasks
type TaskService ¶
type TaskService interface { Create(ctx context.Context, t Task) (*Task, error) Update(ctx context.Context, task Task) error MarkDone(ctx context.Context, id string) error MarkPending(ctx context.Context, id string) error List(ctx context.Context) ([]Task, error) ListDone(ctx context.Context) ([]Task, error) ListPending(ctx context.Context) ([]Task, error) }
TaskService exposes features of the application
Click to show internal directories.
Click to hide internal directories.