cache

package
v1.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CCache

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

func (*CCache) Get

func (c *CCache) Get(key string) interface{}

func (*CCache) GetInt

func (c *CCache) GetInt(key string) int

func (*CCache) GetString

func (c *CCache) GetString(key string) string

func (*CCache) Set

func (c *CCache) Set(key string, val interface{})

func (*CCache) SetInt

func (c *CCache) SetInt(key string, val int)

func (*CCache) SetString

func (c *CCache) SetString(key string, val string)

type CConfig

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

func NewCacheConfig

func NewCacheConfig(ctx context.Context, maxLimitConfigKey config.RootKey, ttlConfigKey config.RootKey, namespace string) *CConfig

func (*CConfig) Category

func (cc *CConfig) Category() (string, error)

func (*CConfig) MaxSize

func (cc *CConfig) MaxSize() (int64, error)

func (*CConfig) TTL

func (cc *CConfig) TTL() time.Duration

func (*CConfig) UniqueName

func (cc *CConfig) UniqueName() (string, error)

type CInterface

type CInterface interface {
	Get(key string) interface{}
	Set(key string, val interface{})

	GetString(key string) string
	SetString(key string, val string)

	GetInt(key string) int
	SetInt(key string, val int)
}

func NewUmanagedCache

func NewUmanagedCache(ctx context.Context, sizeLimit int64, ttl time.Duration) CInterface

should only be used for testing purpose

type Manager

type Manager interface {
	GetCache(cc *CConfig) (CInterface, error)
	ListKeys() []string
}

func NewCacheManager

func NewCacheManager(ctx context.Context) Manager

Jump to

Keyboard shortcuts

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