repository

package
v0.0.0-...-138ac3e Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TaskRepository

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

TaskRepository implements methods to get, create, update and delete Tasks from the database.

func New

func New(db *sql.DB) *TaskRepository

New creates a new TaskRepository.

func (*TaskRepository) Create

func (repo *TaskRepository) Create(task *model.Task) (*model.Task, error)

Create stores a new Task.

func (*TaskRepository) Delete

func (repo *TaskRepository) Delete(id int64) (*model.Task, error)

Delete removes a stored Task.

func (*TaskRepository) Get

func (repo *TaskRepository) Get(id int64) (*model.Task, error)

Get retrieves one stored Task by its id.

func (*TaskRepository) List

func (repo *TaskRepository) List() ([]*model.Task, error)

List retrieves every stored Task.

func (*TaskRepository) Update

func (repo *TaskRepository) Update(task *model.Task) (*model.Task, error)

Update refreshes a stored Task with new values.

Jump to

Keyboard shortcuts

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