db

package
v0.0.0-...-edcad5e Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseTradeLogs     = "base_trade_logs"
	BaseTransferTable = "base_transfer_logs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	GetLastStoredBlock(table string) (int64, error)
	GetSmallestStoredBlock(table string) (int64, error)
	SaveLogs(tradeLogs []common.Tradelog, transferLogs []common.Transferlog, tradeTable, transferTable string) error
}

type Postgres

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

func NewPostgres

func NewPostgres(db *sqlx.DB) *Postgres

func (*Postgres) GetLastStoredBlock

func (pg *Postgres) GetLastStoredBlock(table string) (int64, error)

func (*Postgres) GetSmallestStoredBlock

func (pg *Postgres) GetSmallestStoredBlock(table string) (int64, error)

func (*Postgres) SaveLogs

func (pg *Postgres) SaveLogs(tradeLogs []common.Tradelog, transferLogs []common.Transferlog, tradeTable, transferTable string) error

Jump to

Keyboard shortcuts

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