redis

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessCache added in v1.9.0

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

func NewAccessCache added in v1.9.0

func NewAccessCache(c *redis.Client, wt time.Duration, rt time.Duration) *AccessCache

func (*AccessCache) Delete added in v1.9.6

func (ac *AccessCache) Delete(key string) error

func (*AccessCache) GetAccessStatus added in v1.9.0

func (ac *AccessCache) GetAccessStatus(key string) bool

func (*AccessCache) Set added in v1.9.0

func (ac *AccessCache) Set(key string, timeUnit key.TimeUnit) error

type Cache

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

func NewCache

func NewCache(c *redis.Client, wt time.Duration, rt time.Duration) *Cache

func (*Cache) Delete added in v1.9.6

func (c *Cache) Delete(key string) error

func (*Cache) GetBytes added in v1.7.1

func (c *Cache) GetBytes(key string) ([]byte, error)

func (*Cache) GetCounter

func (c *Cache) GetCounter(keyId string, rateLimitUnit key.TimeUnit) (int64, error)

func (*Cache) IncrementCounter

func (c *Cache) IncrementCounter(keyId string, timeUnit key.TimeUnit, incr int64) error

func (*Cache) Set added in v1.7.1

func (c *Cache) Set(key string, value interface{}, ttl time.Duration) error

type Store

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

func NewStore

func NewStore(c *redis.Client, wt time.Duration, rt time.Duration) *Store

func (*Store) DeleteCounter

func (s *Store) DeleteCounter(keyId string) error

func (*Store) GetCounter

func (s *Store) GetCounter(keyId string) (int64, error)

func (*Store) IncrementCounter

func (s *Store) IncrementCounter(keyId string, incr int64) error

type ThreadCache added in v1.11.0

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

func NewThreadCache added in v1.11.0

func NewThreadCache(c *redis.Client, wt time.Duration, rt time.Duration) *ThreadCache

func (*ThreadCache) Delete added in v1.11.0

func (ac *ThreadCache) Delete(key string) error

func (*ThreadCache) GetThreadStatus added in v1.11.0

func (ac *ThreadCache) GetThreadStatus(key string) bool

func (*ThreadCache) Set added in v1.11.0

func (ac *ThreadCache) Set(key string, dur time.Duration) error

Jump to

Keyboard shortcuts

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