backends

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MPL-2.0 Imports: 15 Imported by: 1

Documentation

Overview

package backends provides different storage back ends for the configuration of a

TAP node. Backends need to only be k/v stores. The in-memory provider is given as an example and usefule for testing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryBackend

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

InMemoryBackend implements tap.AuthRegisterBackend to store profile configs in memory

func (*InMemoryBackend) DeleteKey

func (m *InMemoryBackend) DeleteKey(key, orgId string) error

SetKey will set the value of a key in the map

func (*InMemoryBackend) GetAll

func (m *InMemoryBackend) GetAll(orgId string) []interface{}

func (*InMemoryBackend) GetKey

func (m *InMemoryBackend) GetKey(key string, orgId string, target interface{}) error

GetKey will retuyrn the value of a key as an interface

func (*InMemoryBackend) Init

func (m *InMemoryBackend) Init(config interface{}) error

Init will create the initial in-memory store structures

func (*InMemoryBackend) SetKey

func (m *InMemoryBackend) SetKey(key string, orgId string, val interface{}) error

SetKey will set the value of a key in the map

type KeyError added in v1.1.0

type KeyError struct{}

func (KeyError) Error added in v1.1.0

func (e KeyError) Error() string

type MongoBackend added in v1.1.0

type MongoBackend struct {
	Store      persistent.PersistentStorage
	Collection string
}

func (MongoBackend) DeleteKey added in v1.1.0

func (m MongoBackend) DeleteKey(key string, orgId string) error

func (MongoBackend) GetAll added in v1.1.0

func (m MongoBackend) GetAll(orgId string) []interface{}

func (MongoBackend) GetKey added in v1.1.0

func (m MongoBackend) GetKey(key string, orgId string, val interface{}) error

func (MongoBackend) Init added in v1.1.0

func (m MongoBackend) Init(interface{}) error

func (MongoBackend) SetKey added in v1.1.0

func (m MongoBackend) SetKey(key string, orgId string, value interface{}) error

type RedisBackend

type RedisBackend struct {
	HashKeys  bool
	KeyPrefix string
	// contains filtered or unexported fields
}

func (*RedisBackend) Connect added in v1.1.0

func (r *RedisBackend) Connect() error

func (*RedisBackend) DeleteKey

func (r *RedisBackend) DeleteKey(key string, orgId string) error

func (*RedisBackend) GetAll

func (r *RedisBackend) GetAll(orgId string) []interface{}

func (*RedisBackend) GetKey

func (r *RedisBackend) GetKey(key string, orgId string, val interface{}) error

func (*RedisBackend) GetKeys added in v1.1.0

func (r *RedisBackend) GetKeys(filter string) []string

GetKeys will return all keys according to the filter (filter is a prefix - e.g. tyk.keys.*)

func (*RedisBackend) Init

func (r *RedisBackend) Init(config interface{}) error

Init will create the initial in-memory store structures

func (*RedisBackend) SetDb added in v1.1.0

func (r *RedisBackend) SetDb(kv temporal.KeyValue)

SetDb from existent connection

func (*RedisBackend) SetKey

func (r *RedisBackend) SetKey(key string, orgId string, val interface{}) error

Jump to

Keyboard shortcuts

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