repository

package
v0.0.12-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventRepository

type EventRepository interface {
	PersistLogs(logs []types.Log, eventInfo types.Event, contractAddr, contractName string) error
	CreateEventTable(contractAddr string, event types.Event) (bool, error)
	CreateContractSchema(contractName string) (bool, error)
	CheckSchemaCache(key string) (interface{}, bool)
	CheckTableCache(key string) (interface{}, bool)
}

EventRepository is used to persist event data into custom tables

func NewEventRepository

func NewEventRepository(db *postgres.DB) EventRepository

NewEventRepository returns a new EventRepository

type HeaderRepository

type HeaderRepository interface {
	AddCheckColumn(id string) error
	AddCheckColumns(ids []string) error
	MarkHeaderChecked(headerID int64, eventID string) error
	MarkHeaderCheckedForAll(headerID int64, ids []string) error
	MarkHeadersCheckedForAll(headers []core.Header, ids []string) error
	MissingHeaders(startingBlockNumber int64, endingBlockNumber int64, eventID string) ([]core.Header, error)
	MissingMethodsCheckedEventsIntersection(startingBlockNumber, endingBlockNumber int64, methodIds, eventIds []string) ([]core.Header, error)
	MissingHeadersForAll(startingBlockNumber, endingBlockNumber int64, ids []string) ([]core.Header, error)
	CheckCache(key string) (interface{}, bool)
}

HeaderRepository interfaces with the header and checked_headers tables

func NewHeaderRepository

func NewHeaderRepository(db *postgres.DB) HeaderRepository

NewHeaderRepository returns a new HeaderRepository

type MethodRepository

type MethodRepository interface {
	PersistResults(results []types.Result, methodInfo types.Method, contractAddr, contractName string) error
	CreateMethodTable(contractAddr string, method types.Method) (bool, error)
	CreateContractSchema(contractAddr string) (bool, error)
	CheckSchemaCache(key string) (interface{}, bool)
	CheckTableCache(key string) (interface{}, bool)
}

MethodRepository is used to persist public getter method data

func NewMethodRepository

func NewMethodRepository(db *postgres.DB) MethodRepository

NewMethodRepository returns a new MethodRepository

Jump to

Keyboard shortcuts

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