connection

package
v5.4.1 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 8

Documentation

Overview

Package connection is a cache which may be used by the plugin to store connection specific data, for example credentials and hydrate function results

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

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 ForceImport

type ForceImport string

ForceImport is a mechanism to ensure godoc can reference all required packages

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