future_baking_rights

package
v0.0.0-...-80b2b3e Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

type Repo interface {
	List(filter models.RightFilter, limit, offset uint) (rights []models.FutureBakingRight, err error)
	ListDesc(filter models.RightFilter) (rights []models.FutureBakingRight, err error)
	LastFuture() (found bool, right models.FutureBakingRight, err error)
	Find(filter models.RightFilter) (found bool, right models.FutureBakingRight, err error)
	Create(right models.FutureBakingRight) error
	CreateBulk(rights []models.FutureBakingRight) error
	Count(models.RightFilter) (count int64, err error)
}

type Repository

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

Repository is the baking rights repo implementation.

func New

func New(db *gorm.DB) *Repository

New creates an instance of repository using the provided db.

func (*Repository) Count

func (r *Repository) Count(filter models.RightFilter) (count int64, err error)

func (*Repository) Create

func (r *Repository) Create(right models.FutureBakingRight) error

Create creates a FutureBakingRight.

func (*Repository) CreateBulk

func (r *Repository) CreateBulk(rights []models.FutureBakingRight) error

func (*Repository) Find

func (r *Repository) Find(filter models.RightFilter) (found bool, right models.FutureBakingRight, err error)

Find looks up for rights with filter.

func (*Repository) FutureList

func (r *Repository) FutureList(filter models.RightFilter, limit, offset uint) (rights []models.FutureBakingRight, err error)

func (*Repository) FutureListDesc

func (r *Repository) FutureListDesc(filter models.RightFilter) (rights []models.FutureBakingRight, err error)

ListDesc returns a list of rights from the newest to the oldest. limit defines the limit for the maximum number of rights returned. since is used to paginate results based on the level. As the result is ordered descendingly the rights with level < since will be returned.

func (*Repository) LastFuture

func (r *Repository) LastFuture() (found bool, right models.FutureBakingRight, err error)

Last future baking right

func (*Repository) List

func (r *Repository) List(filter models.RightFilter, limit, offset uint) (rights []models.FutureBakingRight, err error)

List returns a list of rights from the oldest to the newest. limit defines the limit for the maximum number of rights returned. since is used to paginate results based on the level. As the result is ordered descendingly the rights with level < since will be returned.

func (*Repository) ListDesc

func (r *Repository) ListDesc(filter models.RightFilter) (rights []models.FutureBakingRight, err error)

ListDesc returns a list of rights from the newest to the oldest. limit defines the limit for the maximum number of rights returned. since is used to paginate results based on the level. As the result is ordered descendingly the rights with level < since will be returned.

Jump to

Keyboard shortcuts

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