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
Click to show internal directories.
Click to hide internal directories.