dedup

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2018 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deduplicator

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

Deduplicator filters out already received messages for a current filter. It keeps a limited cache of the messages.

func NewDeduplicator

func NewDeduplicator(keyPairProvider keyPairProvider, db *leveldb.DB) *Deduplicator

NewDeduplicator creates a new deduplicator

func (*Deduplicator) AddMessages

func (d *Deduplicator) AddMessages(messages []*whisper.Message) error

AddMessages adds a message to the deduplicator DB, so it will be filtered out.

func (*Deduplicator) Deduplicate

func (d *Deduplicator) Deduplicate(messages []*whisper.Message) []*whisper.Message

Deduplicate receives a list of whisper messages and returns the list of the messages that weren't filtered previously for the specified filter.

Jump to

Keyboard shortcuts

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