crawler

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressEvent

type AddressEvent struct {
	EventType    EventType
	AccountIndex int
	Address      string
	Utxos        []explorer.Utxo
}

func (AddressEvent) Type

func (a AddressEvent) Type() EventType

type AddressObservable

type AddressObservable struct {
	AccountIndex int
	Address      string
	BlindingKey  []byte
}

type Event

type Event interface {
	Type() EventType
}

Event are emitted through a channel during observation.

type EventType

type EventType int
const (
	FeeAccountDeposit EventType = iota
	MarketAccountDeposit
	TransactionConfirmed
	TransactionUnConfirmed
)

func (EventType) String

func (et EventType) String() string

type Observable

type Observable interface {
	// contains filtered or unexported methods
}

Observable represent object that can be observe on the blockchain.

type Opts

type Opts struct {
	ExplorerSvc            explorer.Service
	IntervalInMilliseconds int
	Observables            []Observable
	ErrorHandler           func(err error)
}

Opts defines the parameters needed for creating a crawler service with NewService method

type Service

type Service interface {
	Start()
	Stop()
	AddObservable(observable Observable)
	RemoveObservable(observable Observable)
	IsObservingAddresses(addresses []string) bool
	GetEventChannel() chan Event
}

Service is the interface for Crawler

func NewService

func NewService(opts Opts) Service

NewService returns an utxoCrawelr that is ready for watch for blockchain activites. Use Start and Stop methods to manage it.

type TransactionEvent

type TransactionEvent struct {
	TxID      string
	EventType EventType
	BlockHash string
	BlockTime float64
}

func (TransactionEvent) Type

func (t TransactionEvent) Type() EventType

type TransactionObservable

type TransactionObservable struct {
	TxID string
}

Jump to

Keyboard shortcuts

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