backend

package
v0.0.0-...-765cc39 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckWithBackoff

func CheckWithBackoff(checker Checker) bool

Types

type Checker

type Checker interface {
	Check() bool
}

func NewChecker

func NewChecker(backend *config.Backend) Checker

type ETHChecker

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

func (*ETHChecker) Check

func (e *ETHChecker) Check() bool

type ETHClient

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

func NewETHClient

func NewETHClient(url string) *ETHClient

func (*ETHClient) BlockNumber

func (c *ETHClient) BlockNumber() (uint64, error)

func (*ETHClient) GetBlockByNumber

func (c *ETHClient) GetBlockByNumber(number uint64, includeBodies bool) (json.RawMessage, error)

func (*ETHClient) GetTransactionReceipt

func (c *ETHClient) GetTransactionReceipt(hash string) (json.RawMessage, error)

type Switcher

type Switcher interface {
	pkg.Service
	BackendFor(t pkg.BackendType) (*config.Backend, error)
	ETHClient() (*ETHClient, error)
}

func NewSwitcher

func NewSwitcher(backendCfg []config.Backend) Switcher

type SwitcherImpl

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

func (*SwitcherImpl) BackendFor

func (h *SwitcherImpl) BackendFor(t pkg.BackendType) (*config.Backend, error)

func (*SwitcherImpl) ETHClient

func (h *SwitcherImpl) ETHClient() (*ETHClient, error)

func (*SwitcherImpl) Start

func (h *SwitcherImpl) Start() error

func (*SwitcherImpl) Stop

func (h *SwitcherImpl) Stop() error

Jump to

Keyboard shortcuts

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