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, impression *dtos.Impression) (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, impression *dtos.Impression) (int64, error)
Process an impression and return the 64 LSBs of a murmur3-128 digest
type ImpressionManager ¶
type ImpressionManager interface {
ProcessImpressions(impressions []dtos.Impression) ([]dtos.Impression, []dtos.Impression)
}
ImpressionManager interface
func NewImpressionManager ¶
func NewImpressionManager(managerConfig conf.ManagerConfig, impressionCounter *ImpressionsCounter) (ImpressionManager, error)
NewImpressionManager creates new ImpManager
type ImpressionManagerImpl ¶
type ImpressionManagerImpl struct {
// contains filtered or unexported fields
}
ImpressionManagerImpl implements
func (*ImpressionManagerImpl) ProcessImpressions ¶
func (i *ImpressionManagerImpl) ProcessImpressions(impressions []dtos.Impression) ([]dtos.Impression, []dtos.Impression)
ProcessImpressions bulk processes
type ImpressionObserver ¶
type ImpressionObserver interface {
TestAndSet(featureName string, impression *dtos.Impression) (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, impression *dtos.Impression) (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, impression *dtos.Impression) (int64, error)
TestAndSet that does nothing
type ImpressionsCounter ¶
type ImpressionsCounter struct {
// contains filtered or unexported fields
}
ImpressionsCounter struct for storing generated impressions counts
func NewImpressionsCounter ¶
func NewImpressionsCounter() *ImpressionsCounter
NewImpressionsCounter creates new ImpressionsCounter
func (*ImpressionsCounter) Inc ¶
func (i *ImpressionsCounter) Inc(splitName string, timeFrame int64, amount int64)
Inc increments the quantity of impressions with the passed splitName and timeFrame
func (*ImpressionsCounter) PopAll ¶
func (i *ImpressionsCounter) PopAll() map[Key]int64
PopAll returns all the elements stored in the cache and resets the cache
func (*ImpressionsCounter) Size ¶
func (i *ImpressionsCounter) Size() int
Size returns how many keys are stored in cache