Documentation ¶
Index ¶
- type Repo
- type Repository
- func (r *Repository) Count(filter models.RightFilter) (count int64, err error)
- func (r *Repository) CreateBulk(rights []models.EndorsementRight) error
- func (r *Repository) Find(filter models.RightFilter) (found bool, right models.FutureBakingRight, err error)
- func (r *Repository) Last() (found bool, right models.FutureEndorsementRight, err error)
- func (r *Repository) List(filter models.RightFilter, limit, offset uint) (rights []models.FutureEndorsementRight, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo interface { Last() (found bool, right models.FutureEndorsementRight, err error) List(filter models.RightFilter, limit, offset uint) (rights []models.FutureEndorsementRight, err error) Count(models.RightFilter) (count int64, err error) CreateBulk(rights []models.EndorsementRight) 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) CreateBulk ¶
func (r *Repository) CreateBulk(rights []models.EndorsementRight) 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) Last ¶
func (r *Repository) Last() (found bool, right models.FutureEndorsementRight, err error)
func (*Repository) List ¶
func (r *Repository) List(filter models.RightFilter, limit, offset uint) (rights []models.FutureEndorsementRight, 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.
Click to show internal directories.
Click to hide internal directories.