db

package
v0.0.0-...-6ca747c Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func SetupDB

func SetupDB(config *DBConfig) (*DB, error)

func (*DB) AddNewIndexingEntry

func (db *DB) AddNewIndexingEntry(obj *Indexooor) error

func (*DB) Close

func (db *DB) Close()

func (*DB) CreateNewRun

func (db *DB) CreateNewRun(run *Run) error

func (*DB) FetchRunByID

func (db *DB) FetchRunByID(id uint64) (*Run, error)

FetchRunByID fetches an existing run from runs table by ID

func (*DB) UpdateRun

func (db *DB) UpdateRun(id uint64, lastBlock uint64) error

UpdateRun updates an existing run instance given ID and last block (indexed) number

type DBConfig

type DBConfig struct {
	Host     string
	Port     uint64
	User     string
	Dbname   string
	Password string
	Sslmode  string
}

type Indexooor

type Indexooor struct {
	Slot         string `db:"slot"`
	Contract     string `db:"contract"`
	Value        string `db:"value"`
	VariableName string `db:"variable_name"`
	Key          string `db:"key"`
	DeepKey      string `db:deep_key`
	StructVar    string `db:struct_var`
}

type Run

type Run struct {
	Id         uint64         `db:"id"`
	StartBlock uint64         `db:"start_block"`
	LastBlock  uint64         `db:"end_block"`
	Contracts  pq.StringArray `db:"contracts"`
}

Jump to

Keyboard shortcuts

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