Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TodoCtxKey = &todoCtxKey{}
Functions ¶
Types ¶
type ErrNotFound ¶
type ErrNotFound struct {
// contains filtered or unexported fields
}
func (ErrNotFound) Error ¶
func (e ErrNotFound) Error() string
type Repository ¶
type Repository interface { FindByID(context.Context, string) (Todo, error) FindByTag(context.Context, string) ([]Todo, error) ListAll(context.Context) ([]Todo, error) Add(context.Context, Todo) error Delete(context.Context, string) error Update(context.Context, string, Todo) error }
func NewDbRepository ¶
func NewDbRepository(c *sql.DB) Repository
func NewInMemoryRepository ¶
func NewInMemoryRepository() Repository
type Service ¶
type Service interface { FindByID(context.Context, string) (Todo, error) FindByTags(context.Context, []string) ([]Todo, error) ListAll(context.Context) ([]Todo, error) Add(context.Context, Todo) (Todo, error) Delete(context.Context, string) error Update(context.Context, string, Todo) (Todo, error) MarkCompleted(context.Context, Todo) (Todo, error) }
func NewService ¶
Click to show internal directories.
Click to hide internal directories.