Documentation ¶
Index ¶
- type Repo
- type Repository
- func (r *Repository) Count(ids, kinds, inBlocks, accountIDs []string, maxOperationID int64) (count int64, err error)
- func (r *Repository) EndorsementsFor(blockLevel int64) (operations []models.Operation, err error)
- func (r *Repository) Last() (operation models.Operation, err error)
- func (r *Repository) List(ids, kinds []string, inBlocks, accountIDs []string, limit, offset uint, ...) (operations []models.Operation, err error)
- func (r *Repository) ListAsc(kinds []string, limit, offset uint, after int64) (operations []models.Operation, err error)
- func (r *Repository) ListDoubleEndorsementsWithoutLevel(limit, offset uint) (operations []models.Operation, err error)
- func (r *Repository) UpdateLevel(operation models.Operation) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo interface { List(ids, kinds []string, inBlocks, accountIDs []string, limit, offset uint, since int64) (operations []models.Operation, err error) ListAsc(kinds []string, limit, offset uint, after int64) (operations []models.Operation, err error) Count(ids, kinds, inBlocks, accountIDs []string, maxOperationID int64) (count int64, err error) EndorsementsFor(blockLevel int64) (operations []models.Operation, err error) Last() (operation models.Operation, err error) ListDoubleEndorsementsWithoutLevel(limit, offset uint) (operations []models.Operation, err error) UpdateLevel(operation models.Operation) error }
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository is the operation 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(ids, kinds, inBlocks, accountIDs []string, maxOperationID int64) (count int64, err error)
Count counts a number of operations sutisfying the filter.
func (*Repository) EndorsementsFor ¶
func (r *Repository) EndorsementsFor(blockLevel int64) (operations []models.Operation, err error)
EndorsementsFor returns a list of endorsement operations for the provided block level.
func (*Repository) Last ¶
func (r *Repository) Last() (operation models.Operation, err error)
Last returns the last known operation.
func (*Repository) List ¶
func (r *Repository) List(ids, kinds []string, inBlocks, accountIDs []string, limit, offset uint, since int64) (operations []models.Operation, err error)
List returns a list of operations from the newest to oldest. limit defines the limit for the maximum number of operations returned. since is used to paginate results based on the operation id. As the result is ordered descendingly the operations with operation_id < since will be returned.
func (*Repository) ListDoubleEndorsementsWithoutLevel ¶
func (r *Repository) ListDoubleEndorsementsWithoutLevel(limit, offset uint) (operations []models.Operation, err error)
func (*Repository) UpdateLevel ¶
func (r *Repository) UpdateLevel(operation models.Operation) error
Directories ¶
Path | Synopsis |
---|---|
Package mock_operation is a generated GoMock package.
|
Package mock_operation is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.