repo

package
v0.0.0-...-5f2b7d0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBRepo

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

DBRepo defines a DBRepo object

func NewDbRepo

func NewDbRepo(db *sqlx.DB) *DBRepo

NewDbRepo creates a new instance of DBRepo object

func (*DBRepo) Get

func (r *DBRepo) Get(ctx context.Context, book *entities.Book) (*entities.Book, error)

Get get searches the database for a record match

func (*DBRepo) List

func (r *DBRepo) List(ctx context.Context, limit, offset int64, userId string) ([]*entities.Book, error)

List returns list of records that matches the search criteria

func (*DBRepo) Upsert

func (r *DBRepo) Upsert(ctx context.Context, book *entities.Book) (*entities.Book, error)

Upsert updates the record if a record is found, inserts a new record if no record is found.

type IdbRepo

type IdbRepo interface {
	Get(context.Context, *entities.Book) (*entities.Book, error)
	Upsert(context.Context, *entities.Book) (*entities.Book, error)
	List(context.Context, int64, int64, string) ([]*entities.Book, error)
}

IdbRepo defines a dbRepo interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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