deduper

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deduper

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

func New

func New(c DeduperConfig) *Deduper

func (*Deduper) Consume

func (d *Deduper) Consume(input Keyer) (Keyer, time.Time, bool)

Consume input and return:

original value in cache,
time of original value,
true if input is brand new, or false if it's already in cache

type DeduperConfig

type DeduperConfig struct {
	MaxEntries int
}

type Keyer

type Keyer interface {
	// create a key for uniqueness check
	// should be unique, comparable, suitable for map
	Key() interface{}
}

Jump to

Keyboard shortcuts

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