cache

package
v0.0.0-...-db24ddd Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Put(key string, value interface{})
	PutAll(map[string]interface{})
	Get(key string) (interface{}, bool, error)
	GetAll(keys []string) map[string]interface{}
	Clean(key string)
	GetKeys(prefix string) ([]string, error)
	CleanAll()
}

func GetCachingMechanism

func GetCachingMechanism(connStr string) Cache

type LocalCache

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

func GetLocalCache

func GetLocalCache() *LocalCache

func (*LocalCache) Clean

func (c *LocalCache) Clean(key string)

func (*LocalCache) CleanAll

func (c *LocalCache) CleanAll()

func (*LocalCache) Get

func (c *LocalCache) Get(key string) (interface{}, bool, error)

func (*LocalCache) GetAll

func (c *LocalCache) GetAll(keys []string) map[string]interface{}

func (*LocalCache) GetKeys

func (c *LocalCache) GetKeys(prefix string) ([]string, error)

func (*LocalCache) Put

func (c *LocalCache) Put(key string, value interface{})

func (*LocalCache) PutAll

func (c *LocalCache) PutAll(entries map[string]interface{})

type MockCache

type MockCache struct {
}

func (MockCache) Clean

func (m MockCache) Clean(key string)

func (MockCache) CleanAll

func (m MockCache) CleanAll()

func (MockCache) Get

func (m MockCache) Get(key string) (interface{}, bool, error)

func (MockCache) GetAll

func (m MockCache) GetAll(keys []string) map[string]interface{}

func (MockCache) GetKeys

func (m MockCache) GetKeys(prefix string) ([]string, error)

func (MockCache) Put

func (m MockCache) Put(key string, value interface{})

func (MockCache) PutAll

func (m MockCache) PutAll(map[string]interface{})

type RedisCache

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

func GetRedisCache

func GetRedisCache(connStr string) *RedisCache

func (*RedisCache) Clean

func (rc *RedisCache) Clean(key string)

func (*RedisCache) CleanAll

func (rc *RedisCache) CleanAll()

CleanAll cleans the entire cache.

func (*RedisCache) Get

func (rc *RedisCache) Get(key string) (interface{}, bool, error)

func (*RedisCache) GetAll

func (rc *RedisCache) GetAll(keys []string) map[string]interface{}

func (*RedisCache) GetKeys

func (rc *RedisCache) GetKeys(prefix string) ([]string, error)

func (*RedisCache) Put

func (rc *RedisCache) Put(key string, value interface{})

func (*RedisCache) PutAll

func (rc *RedisCache) PutAll(entries map[string]interface{})

Jump to

Keyboard shortcuts

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