connection

package
v4.1.13 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

deprecated use ConnectionCache

func NewCache

func NewCache(connectionCache *ConnectionCache) *Cache

func (*Cache) Delete

func (c *Cache) Delete(key string)

func (*Cache) Get

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

func (*Cache) Set

func (c *Cache) Set(key string, value interface{}) bool

func (*Cache) SetWithTTL

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

type ConnectionCache

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

ConnectionCache is a simple cache wrapper - multiple connections use the same underlying cache (owned by the plugin) ConnectionCache modifies the cache keys to include the connection name and uses the underlying shared cache

func NewConnectionCache

func NewConnectionCache(connectionName string, connectionCache *cache.Cache[any]) *ConnectionCache

func (*ConnectionCache) Clear added in v4.1.0

func (c *ConnectionCache) Clear(ctx context.Context)

Clear deletes all cache items for this connection

func (*ConnectionCache) Delete

func (c *ConnectionCache) Delete(ctx context.Context, key string)

func (*ConnectionCache) Get

func (c *ConnectionCache) Get(ctx context.Context, key string) (interface{}, bool)

func (*ConnectionCache) Set

func (c *ConnectionCache) Set(ctx context.Context, key string, value interface{}) error

func (*ConnectionCache) SetWithTTL

func (c *ConnectionCache) SetWithTTL(ctx context.Context, key string, value interface{}, ttl time.Duration) error

type Manager

type Manager struct {
	Cache *Cache
}

deprecated use ConnectionCache

func NewManager

func NewManager(connectionCache *ConnectionCache) *Manager

Jump to

Keyboard shortcuts

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