repo

package
v1.3.17 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewImpl)

ProviderSet is a provider set for wire

Functions

This section is empty.

Types

type IRepo

type IRepo interface {
	// QueryByID serve caller to query a task by id from database
	QueryByID(ctx contextx.Contextx, userID, id, resultID int64) (*todo.Task, error)

	// Create serve caller to create a task to database
	Create(ctx contextx.Contextx, task *todo.Task) (*todo.Task, error)

	// List serve caller to list all tasks from database
	List(ctx contextx.Contextx, userID, resultID int64, offset, limit int) ([]*todo.Task, error)

	// Count serve caller to count all tasks from database
	Count(ctx contextx.Contextx, userID, resultID int64) (int, error)

	// Update serve caller to update a task to database
	Update(ctx contextx.Contextx, updated *todo.Task) (*todo.Task, error)

	// Delete serve caller to delete a task by id from database
	Delete(ctx contextx.Contextx, userID, id, resultID int64) (int, error)
}

IRepo declare todo repo service function

func CreateRepo

func CreateRepo(path string) (IRepo, error)

CreateRepo serve caller to create an IRepo

func NewImpl

func NewImpl(rw *sqlx.DB) IRepo

NewImpl serve caller to create an IRepo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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