ratz/src/chatservers/timerate/map_window_store.go

type WindowValue

type MapWindowStore

func (m *MapWindowStore) Keys() []string {}

func (m *MapWindowStore) RLock() {}

func (m *MapWindowStore) RUnLock() {}

// NewMapWindowStore creates new in-memory Data store for internal limiter Data. Each element of MapWindowStore is set as expired after expirationTime from its last counter increment. Expired elements are removed with a period specified by the flushInterval argument
func NewMapWindowStore(name string) (m *MapWindowStore) {}

// Inc increments current window limit counter for key
func (m *MapWindowStore) Inc(key string, window time.Time, windowsize time.Duration) error {}

// Get gets value of previous window counter and current window counter for key
func (m *MapWindowStore) Get(key string, previousWindow, currentWindow time.Time, windowsize time.Duration) (prevValue int64, currValue int64, err error) {}

// Size returns current length of Data map
func (m *MapWindowStore) Size() int {}

func mapKey(key string, window time.Time) string {}

func (m *MapWindowStore) Purge(removekey string) {}

func (m *MapWindowStore) start() {}