operation

package
v0.0.0-...-71505b4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: MIT Imports: 2 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(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) ListAsc

func (r *Repository) ListAsc(kinds []string, limit, offset uint, after int64) (operations []models.Operation, err error)

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.

Jump to

Keyboard shortcuts

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