postgres

package
v0.0.0-...-a3e8eeb Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store wraps *sqlx.DB

func NewStore

func NewStore(dbstring string) (*Store, error)

NewStore returns a new Store from the provided databse string, Store implements store.Storer.

func (*Store) DB

func (s *Store) DB() *sql.DB

DB returns the underlying sqlx.DB object

func (*Store) Get

func (s *Store) Get(id string) (*store.Tx, error)

Get returns transaction by given id.

func (*Store) GetByAssetAndSender

func (s *Store) GetByAssetAndSender(asset, address string) ([]*store.Tx, error)

GetByAssetAndSender returns list of transaction filter by given asset and sender address.

func (*Store) GetBySender

func (s *Store) GetBySender(address string) ([]*store.Tx, error)

GetBySender returns list of transaction filter by given sender address.

func (*Store) GetByStatus

func (s *Store) GetByStatus(status string) ([]*store.Tx, error)

GetByStatus returns list of transaction filter by given status

func (*Store) GetLastSyncBlockID

func (s *Store) GetLastSyncBlockID() uint64

GetLastSyncBlockID returns last synced block id.

func (*Store) GetLatestBlockID

func (s *Store) GetLatestBlockID() (uint64, error)

GetLatestBlockID returns latest block id from saved transaction

func (*Store) GetTxByTypeBlockHeight

func (s *Store) GetTxByTypeBlockHeight(txType string, height uint64) ([]*store.Tx, error)

GetTxByTypeBlockHeight returns list of transaction filter by given block height.

func (*Store) Save

func (s *Store) Save(tx *store.Tx) error

Save stores store.Tx to database.

func (*Store) SaveLastSyncBlockID

func (s *Store) SaveLastSyncBlockID(blockID uint64) error

SaveLastSyncBlockID save last synced block id to database.

func (*Store) Update

func (s *Store) Update(tx *store.Tx) error

Update updatess a current store.Tx in database.

Jump to

Keyboard shortcuts

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