todos

package
Version: v0.0.0-...-4d4bbb7 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTodoService

func NewTodoService(database database.Options) todosv1.TodoServiceServer

NewTodoService create new todo service instance

Types

type TodoDatastore

type TodoDatastore interface {
	Fetch(ctx context.Context) ([]*todosv1.Todo, error)
	FetchOne(ctx context.Context, id int) (*todosv1.Todo, error)
	Insert(ctx context.Context, todo *todosv1.Todo) (int, error)
	Update(ctx context.Context, id int, todo *todosv1.Todo) error
	Delete(ctx context.Context, id int) error
}

TodoDatastore todo datastore abstraction.

type TodoService

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

TodoService implement todosv1.TodoServiceServer

func (*TodoService) CreateTodo

func (s *TodoService) CreateTodo(ctx context.Context, req *todosv1.CreateTodoRequest) (*todosv1.Todo, error)

CreateTodo service handler

func (*TodoService) DeleteTodo

func (s *TodoService) DeleteTodo(ctx context.Context, req *todosv1.DeleteTodoRequest) (*empty.Empty, error)

DeleteTodo service handler

func (*TodoService) GetTodo

func (s *TodoService) GetTodo(ctx context.Context, req *todosv1.GetTodoRequest) (*todosv1.Todo, error)

GetTodo service handler

func (*TodoService) ListTodo

ListTodo service handler

func (*TodoService) UpdateTodo

func (s *TodoService) UpdateTodo(ctx context.Context, req *todosv1.UpdateTodoRequest) (*todosv1.Todo, error)

UpdateTodo service handler

Jump to

Keyboard shortcuts

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