stringfilter

package
v3.10.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BloomFilter added in v3.5.3

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

BloomFilter implements the Filter interface using a bloom filter so that mostly unique items get through the filter.

func NewBloomFilter added in v3.5.3

func NewBloomFilter(num int64) *BloomFilter

NewBloomFilter returns an initialized BloomFilter.

func (*BloomFilter) Duplicate added in v3.5.3

func (r *BloomFilter) Duplicate(s string) bool

Duplicate implements the Filter interface.

func (*BloomFilter) Has added in v3.5.3

func (r *BloomFilter) Has(s string) bool

Has implements the Filter interface.

type Filter added in v3.5.3

type Filter interface {
	// Duplicate checks if the name provided has been seen before by this filter.
	// If not, the string is added to the filter.
	Duplicate(s string) bool

	// Has returns true if the receiver StringFilter already contains the string argument.
	Has(s string) bool
}

Filter is the object type for performing string filtering.

type StringFilter

type StringFilter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

StringFilter implements the Filter interface using a Set so that only unique items get through the filter.

func NewStringFilter

func NewStringFilter() *StringFilter

NewStringFilter returns an initialized StringFilter.

func (*StringFilter) Duplicate

func (r *StringFilter) Duplicate(s string) bool

Duplicate implements the Filter interface.

func (*StringFilter) Has added in v3.5.3

func (r *StringFilter) Has(s string) bool

Has implements the Filter interface.

Jump to

Keyboard shortcuts

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