Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DateWeight float64 = 1
View Source
var FrequencyWeight float64 = 1
change these to play with the weights values between 0 and 1 0 will exclude the metric all together from the ordering
Functions ¶
This section is empty.
Types ¶
type FrecencyStore ¶
type FrecencyStore struct { MaxFrequency int OldestDate time.Time Entries []*Entry // contains filtered or unexported fields }
func Load ¶
func Load(fecencyStoreKey string) (*FrecencyStore, error)
func (*FrecencyStore) Delete ¶
func (store *FrecencyStore) Delete(toRemove interface{}) error
delete a single entry from the frecency store
func (*FrecencyStore) DeleteAll ¶
func (store *FrecencyStore) DeleteAll(toRemove []interface{}) error
deletes all elements from the frecency store
func (*FrecencyStore) GetFrecentEntriess ¶
func (store *FrecencyStore) GetFrecentEntriess(optionalLimit *int) []interface{}
Returns the cached entries stored in descending order by frecency, optionally limit the returned results
func (*FrecencyStore) Upsert ¶
func (store *FrecencyStore) Upsert(newEntry interface{}) error
Save a new reason to the frecency cache. This operation will reevaluate the frecency scores after inserting the new reason if the reason already exists, the frequency will be increased as well as the last used date the newReason will always be saved at the top of the list
Click to show internal directories.
Click to hide internal directories.