txfeed

package
Version: v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2020 License: AGPL-3.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

View Source
const (
	//FilterNumMax max txfeed filter amount.
	FilterNumMax = 1024
)

Variables

View Source
var (
	//ErrDuplicateAlias means error of duplicate feed alias.
	ErrDuplicateAlias = errors.New("duplicate feed alias")
	//ErrEmptyAlias means error of empty feed alias.
	ErrEmptyAlias = errors.New("empty feed alias")
	//ErrNumExceedlimit means txfeed filter number exceeds the limit.
	ErrNumExceedlimit = errors.New("txfeed exceed limit")
)

Functions

This section is empty.

Types

type Tracker

type Tracker struct {
	DB      dbm.DB
	TxFeeds []*TxFeed
	// contains filtered or unexported fields
}

Tracker filter tracker object.

func NewTracker added in v0.2.0

func NewTracker(db dbm.DB, chain *protocol.Chain) *Tracker

NewTracker create new txfeed tracker.

func (*Tracker) Create

func (t *Tracker) Create(ctx context.Context, alias, fil string) error

Create create a txfeed filter.

func (*Tracker) Delete

func (t *Tracker) Delete(ctx context.Context, alias string) error

Delete delete txfeed with alias.

func (*Tracker) Get added in v0.2.0

func (t *Tracker) Get(ctx context.Context, alias string) (*TxFeed, error)

Get get txfeed filter with alias.

func (*Tracker) GetTxfeedCh added in v0.2.0

func (t *Tracker) GetTxfeedCh() chan *types.Tx

GetTxfeedCh return a txfeed channel.

func (*Tracker) Prepare added in v0.2.0

func (t *Tracker) Prepare(ctx context.Context) error

Prepare load and parse filters.

func (*Tracker) TxFilter added in v0.2.0

func (t *Tracker) TxFilter(tx *types.Tx) error

TxFilter filter tx from mempool.

type TxFeed

type TxFeed struct {
	ID     string `json:"id,omitempty"`
	Alias  string `json:"alias"`
	Filter string `json:"filter,omitempty"`
	Param  filter `json:"param,omitempty"`
}

TxFeed describe a filter

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL