todo

package
v0.0.0-...-1cea508 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func NewStore

func NewStore(pgClient postgres.Client) Store

NewStore creates a new Store

func (*Store) DeleteTodo

func (s *Store) DeleteTodo(ctx context.Context, id int) (int, error)

DeleteTodo deletes a TodoItem from the database

func (*Store) GetTodo

func (s *Store) GetTodo(ctx context.Context, id int) (models.TodoItem, bool, error)

GetTodo gets a TodoItem from the database

func (*Store) PostTodo

func (s *Store) PostTodo(ctx context.Context, todo models.TodoItem) (int, error)

PostTodo posts a TodoItem to the database

type TodoStore

type TodoStore interface {
	GetTodo(ctx context.Context, id int) (models.TodoItem, bool, error)
	DeleteTodo(ctx context.Context, id int) (int, error)
	PostTodo(ctx context.Context, todo models.TodoItem) (int, error)
}

Jump to

Keyboard shortcuts

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