algorithm

package
v0.0.0-...-25c57ca Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LifeTime       = 1800
	PrecomputedLen = 64
	HalfLife       = 60
	Lambda         = math.Ln2 / HalfLife
)

Variables

This section is empty.

Functions

func MinUint32

func MinUint32(a, b uint32) uint32

Types

type DynamicBanScore

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

func (*DynamicBanScore) Increase

func (dynamicBanScore *DynamicBanScore) Increase(persistent, transient uint32) uint32

func (*DynamicBanScore) Int

func (dynamicBanScore *DynamicBanScore) Int() uint32

func (*DynamicBanScore) Reset

func (dynamicBanScore *DynamicBanScore) Reset()

func (*DynamicBanScore) String

func (dynamicBanScore *DynamicBanScore) String() string

type Int64Sorter

type Int64Sorter []int64

func (Int64Sorter) Len

func (sorter Int64Sorter) Len() int

func (Int64Sorter) Less

func (sorter Int64Sorter) Less(i, j int) bool

func (Int64Sorter) Swap

func (sorter Int64Sorter) Swap(i, j int)

type KeyValue

type KeyValue struct {
	Key, Value interface{}
}

type LRUCache

type LRUCache struct {
	Length int
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache(length int) *LRUCache

func (*LRUCache) Add

func (lru *LRUCache) Add(k, v interface{}) error

func (*LRUCache) Exists

func (lru *LRUCache) Exists(k interface{}) bool

func (*LRUCache) Get

func (lru *LRUCache) Get(k interface{}) (interface{}, bool, error)

func (*LRUCache) Remove

func (lru *LRUCache) Remove(k interface{}) bool

func (*LRUCache) Size

func (lru *LRUCache) Size() int

Jump to

Keyboard shortcuts

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