provisional

package
v2.0.0-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImpressionHasher

type ImpressionHasher interface {
	Process(featureName string, keyImpression *dtos.ImpressionDTO) (int64, error)
}

ImpressionHasher interface

type ImpressionHasherImpl

type ImpressionHasherImpl struct{}

ImpressionHasherImpl implements the hasher interface, mapping certain fields to an int64

func (*ImpressionHasherImpl) Process

func (h *ImpressionHasherImpl) Process(featureName string, keyImpression *dtos.ImpressionDTO) (int64, error)

Process an impression and return the 64 LSBs of a murmur3-128 digest

type ImpressionObserver

type ImpressionObserver interface {
	TestAndSet(featureName string, keyImpression *dtos.ImpressionDTO) (int64, error)
}

ImpressionObserver is used to check wether an impression has been previously seen

type ImpressionObserverImpl

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

ImpressionObserverImpl is an implementation of the ImpressionObserver interface

func NewImpressionObserver

func NewImpressionObserver(size int) (*ImpressionObserverImpl, error)

NewImpressionObserver constructs a new ImpressionObserver

func (*ImpressionObserverImpl) TestAndSet

func (o *ImpressionObserverImpl) TestAndSet(featureName string, keyImpression *dtos.ImpressionDTO) (int64, error)

TestAndSet hashes the impression, updates the cache and returns the previous value

type ImpressionObserverNoOp

type ImpressionObserverNoOp struct{}

ImpressionObserverNoOp is an implementation of the ImpressionObserver interface

func (*ImpressionObserverNoOp) TestAndSet

func (o *ImpressionObserverNoOp) TestAndSet(featureName string, keyImpression *dtos.ImpressionDTO) (int64, error)

TestAndSet that does nothing

Jump to

Keyboard shortcuts

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