pq

package
v0.0.78 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateEnvelope added in v0.0.46

func MigrateEnvelope(db *sql.DB, up bool) (int, error)

func MigrateIndexer added in v0.0.46

func MigrateIndexer(db *sql.DB, up bool) (int, error)

func MigratePublicKey added in v0.0.46

func MigratePublicKey(db *sql.DB, up bool) (int, error)

func NewConnection

func NewConnection(user, password, databaseName, host, sslmode string, port int) (*sqlx.DB, error)

func NewPublicKeyStore

func NewPublicKeyStore(db *sqlx.DB) (datastore.PublicKeyStore, error)

PublicKeyStore create new pointer to postgres database

func NewSyncStore

func NewSyncStore(db *sqlx.DB) (datastore.SyncStore, error)

NewSyncStore create new postgres database

func NewTransactionStore

func NewTransactionStore(db *sqlx.DB) (datastore.TransactionStore, error)

Types

type PublicKeyStore

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

PublicKeyStore database connection object

func (PublicKeyStore) GetPublicKey

func (s PublicKeyStore) GetPublicKey(ctx context.Context, protocol, network string, address []byte) (pubKey *datastore.PublicKey, err error)

func (PublicKeyStore) PutPublicKey

func (s PublicKeyStore) PutPublicKey(ctx context.Context, protocol, network string, address []byte, pubKey *datastore.PublicKey) error

type SyncStore

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

SyncStore database connection object

func (SyncStore) GetBlockNumber

func (s SyncStore) GetBlockNumber(ctx context.Context, protocol, network string) (blockNo uint64, err error)

func (SyncStore) PutBlockNumber

func (s SyncStore) PutBlockNumber(ctx context.Context, protocol, network string, blockNo uint64) error

type TransactionStore

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

func (*TransactionStore) GetTransactionsFrom

func (s *TransactionStore) GetTransactionsFrom(ctx context.Context, protocol, network string, address []byte) ([]datastore.Transaction, error)

func (*TransactionStore) GetTransactionsTo

func (s *TransactionStore) GetTransactionsTo(ctx context.Context, protocol, network string, address []byte) ([]datastore.Transaction, error)

func (*TransactionStore) PutTransaction

func (s *TransactionStore) PutTransaction(ctx context.Context, protocol, network string, hash []byte, tx *datastore.Transaction) error

Jump to

Keyboard shortcuts

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