chain_events

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Event event // singleton of type event

Functions

This section is empty.

Types

type GetEventTypes

type GetEventTypes func() []string

type GormStore

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

func NewGormStore

func NewGormStore(db *gorm.DB) *GormStore

func (*GormStore) GetListenerStatus

func (s *GormStore) GetListenerStatus() (t *ListenerStatus, err error)

func (*GormStore) UpdateListenerStatus

func (s *GormStore) UpdateListenerStatus(t *ListenerStatus) error

type Listener

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

func NewListener

func NewListener(
	fc *client.Client,
	db Store,
	maxDiff uint64,
	interval time.Duration,
	getTypes GetEventTypes,
) *Listener

func (*Listener) Start

func (l *Listener) Start() *Listener

func (*Listener) Stop

func (l *Listener) Stop()

type ListenerStatus

type ListenerStatus struct {
	gorm.Model
	LatestHeight uint64
}

func (ListenerStatus) TableName

func (ListenerStatus) TableName() string

type Store

type Store interface {
	UpdateListenerStatus(s *ListenerStatus) error
	GetListenerStatus() (*ListenerStatus, error)
}

Store manages data regarding tokens.

Jump to

Keyboard shortcuts

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