cache

package
v0.0.3-beta Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseCache

type BaseCache struct{}

func (*BaseCache) Clear

func (bc *BaseCache) Clear() bool

func (*BaseCache) Get

func (bc *BaseCache) Get(key string) string

func (*BaseCache) Ping

func (bc *BaseCache) Ping() int

func (*BaseCache) Set

func (bc *BaseCache) Set(key, value string, ttl int32) bool

type Cache

type Cache interface {
	Set(string, string, int32) bool
	Get(string) string
	Clear() bool
	Ping() int
}

func Create

func Create(cacheType, prefix, config string) Cache

type GocacheCache

type GocacheCache struct {
	BaseCache
	// contains filtered or unexported fields
}

func NewGocacheCache

func NewGocacheCache(prefix, config string) *GocacheCache

func (*GocacheCache) Clear

func (gc *GocacheCache) Clear() bool

func (*GocacheCache) Get

func (gc *GocacheCache) Get(key string) string

func (*GocacheCache) Set

func (gc *GocacheCache) Set(key, value string, ttl int32) bool

type MemcacheCache

type MemcacheCache struct {
	BaseCache
	// contains filtered or unexported fields
}

func NewMemcacheCache

func NewMemcacheCache(prefix, config string) *MemcacheCache

func (*MemcacheCache) Clear

func (mc *MemcacheCache) Clear() bool

func (*MemcacheCache) Get

func (mc *MemcacheCache) Get(key string) string

func (*MemcacheCache) Set

func (mc *MemcacheCache) Set(key, value string, ttl int32) bool

type NoCache

type NoCache struct {
	BaseCache
}

type RedisCache

type RedisCache struct {
	BaseCache
	// contains filtered or unexported fields
}

func NewRedisCache

func NewRedisCache(prefix, config string) *RedisCache

func (*RedisCache) Clear

func (rc *RedisCache) Clear() bool

func (*RedisCache) Get

func (rc *RedisCache) Get(key string) string

func (*RedisCache) Set

func (rc *RedisCache) Set(key, value string, ttl int32) bool

Jump to

Keyboard shortcuts

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