filter

package
v1.32.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: Apache-2.0, MIT Imports: 19 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFilterAlreadyRegistered = errors.New("filter already registered")
	ErrFilterNotFound          = errors.New("filter not found")
	ErrMaximumNumberOfFilters  = errors.New("maximum number of filters registered")
)

Functions

This section is empty.

Types

type AddressResolver added in v1.26.0

type AddressResolver func(context.Context, abi.ActorID, *types.TipSet) address.Address

AddressResolver is a function that resolves an actor ID to an address. If the actor ID cannot be resolved to an address, the function must return address.Undef.

type EventFilter

type EventFilter interface {
	Filter

	TakeCollectedEvents(context.Context) []*index.CollectedEvent
	CollectEvents(context.Context, *TipSetEvents, bool, AddressResolver) error
}

type EventFilterManager

type EventFilterManager struct {
	ChainStore       *cstore.ChainStore
	AddressResolver  AddressResolver
	MaxFilterResults int
	ChainIndexer     index.Indexer
	// contains filtered or unexported fields
}

func (*EventFilterManager) Apply

func (m *EventFilterManager) Apply(ctx context.Context, from, to *types.TipSet) error

func (*EventFilterManager) Fill added in v1.30.0

func (m *EventFilterManager) Fill(
	ctx context.Context,
	minHeight,
	maxHeight abi.ChainEpoch,
	tipsetCid cid.Cid,
	addresses []address.Address,
	keysWithCodec map[string][]types.ActorEventBlock,
) (EventFilter, error)

func (*EventFilterManager) Install

func (m *EventFilterManager) Install(
	ctx context.Context,
	minHeight,
	maxHeight abi.ChainEpoch,
	tipsetCid cid.Cid,
	addresses []address.Address,
	keysWithCodec map[string][]types.ActorEventBlock,
) (EventFilter, error)

func (*EventFilterManager) Remove

func (*EventFilterManager) Revert

func (m *EventFilterManager) Revert(ctx context.Context, from, to *types.TipSet) error

type Filter

type Filter interface {
	ID() types.FilterID
	LastTaken() time.Time
	SetSubChannel(chan<- interface{})
	ClearSubChannel()
}

type FilterStore

type FilterStore interface {
	Add(context.Context, Filter) error
	Get(context.Context, types.FilterID) (Filter, error)
	Remove(context.Context, types.FilterID) error
	NotTakenSince(when time.Time) []Filter // returns a list of filters that have not had their collected results taken
}

func NewMemFilterStore

func NewMemFilterStore(maxFilters int) FilterStore

type MemPoolFilter

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

func (*MemPoolFilter) ClearSubChannel

func (f *MemPoolFilter) ClearSubChannel()

func (*MemPoolFilter) CollectMessage

func (f *MemPoolFilter) CollectMessage(ctx context.Context, msg *types.SignedMessage)

func (*MemPoolFilter) ID

func (f *MemPoolFilter) ID() types.FilterID

func (*MemPoolFilter) LastTaken

func (f *MemPoolFilter) LastTaken() time.Time

func (*MemPoolFilter) SetSubChannel

func (f *MemPoolFilter) SetSubChannel(ch chan<- interface{})

func (*MemPoolFilter) TakeCollectedMessages

func (f *MemPoolFilter) TakeCollectedMessages(context.Context) []*types.SignedMessage

type MemPoolFilterManager

type MemPoolFilterManager struct {
	MaxFilterResults int
	// contains filtered or unexported fields
}

func (*MemPoolFilterManager) Install

func (*MemPoolFilterManager) Remove

func (*MemPoolFilterManager) WaitForMpoolUpdates

func (m *MemPoolFilterManager) WaitForMpoolUpdates(ctx context.Context, ch <-chan api.MpoolUpdate)

type TipSetEvents

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

func (*TipSetEvents) Cid

func (te *TipSetEvents) Cid() (cid.Cid, error)

func (*TipSetEvents) Height

func (te *TipSetEvents) Height() abi.ChainEpoch

type TipSetFilter

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

func (*TipSetFilter) ClearSubChannel

func (f *TipSetFilter) ClearSubChannel()

func (*TipSetFilter) CollectTipSet

func (f *TipSetFilter) CollectTipSet(ctx context.Context, ts *types.TipSet)

func (*TipSetFilter) ID

func (f *TipSetFilter) ID() types.FilterID

func (*TipSetFilter) LastTaken

func (f *TipSetFilter) LastTaken() time.Time

func (*TipSetFilter) SetSubChannel

func (f *TipSetFilter) SetSubChannel(ch chan<- interface{})

func (*TipSetFilter) TakeCollectedTipSets

func (f *TipSetFilter) TakeCollectedTipSets(context.Context) []types.TipSetKey

type TipSetFilterManager

type TipSetFilterManager struct {
	MaxFilterResults int
	// contains filtered or unexported fields
}

func (*TipSetFilterManager) Apply

func (m *TipSetFilterManager) Apply(ctx context.Context, from, to *types.TipSet) error

func (*TipSetFilterManager) Install

func (*TipSetFilterManager) Remove

func (*TipSetFilterManager) Revert

func (m *TipSetFilterManager) Revert(ctx context.Context, from, to *types.TipSet) error

Jump to

Keyboard shortcuts

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