Go API Documentation

github.com/TykTechnologies/tyk-pump/storage

No package summary is available.

Package

Files: 2. Third party imports: 4. Imports from organisation: 4. Tests: 0. Benchmarks: 0.

Constants

Vars

Types

AnalyticsStorage

This type doesn't have documentation.

Field name Field type Comment
type

any

No comment on field.

EnvMapString

This type doesn't have documentation.

Field name Field type Comment
type

map[string]string

No comment on field.

TemporalStorageConfig

nolint:govet

Field name Field type Comment
Type

string

Deprecated.

Host

string

Host value. For example: "localhost".

Port

int

Port value. For example: 6379.

Hosts

EnvMapString

Deprecated: use Addrs instead.

Addrs

[]string

Use instead of the host value if you're running a Redis cluster with multiple instances.

MasterName

string

Sentinel master name.

SentinelPassword

string

Sentinel password.

Username

string

Database username.

Password

string

Database password.

Database

int

Database name.

Timeout

int

How long to allow for new connections to be established (in milliseconds). Defaults to 5sec.

MaxIdle

int

Maximum number of idle connections in the pool.

MaxActive

int

Maximum number of connections allocated by the pool at a given time. When zero, there is no limit on the number of connections in the pool. Defaults to 500.

EnableCluster

bool

Enable this option if you are using a cluster instance. Default is false.

RedisKeyPrefix

string

Prefix the key names. Defaults to "analytics-". Deprecated: use KeyPrefix instead.

KeyPrefix

string

Prefix the key names. Defaults to "analytics-".

UseSSL

bool

Setting this to true to use SSL when connecting to the DB.

SSLInsecureSkipVerify

bool

Set this to true to tell Pump to ignore database's cert validation.

SSLCAFile

string

Path to the CA file.

SSLCertFile

string

Path to the cert file.

SSLKeyFile

string

Path to the key file.

SSLMaxVersion

string

Maximum supported TLS version. Defaults to TLS 1.3, valid values are TLS 1.0, 1.1, 1.2, 1.3.

SSLMinVersion

string

Minimum supported TLS version. Defaults to TLS 1.2, valid values are TLS 1.0, 1.1, 1.2, 1.3.

RedisUseSSL

bool

Setting this to true to use SSL when connecting to the DB. Deprecated: use UseSSL instead.

RedisSSLInsecureSkipVerify

bool

Set this to true to tell Pump to ignore database's cert validation. Deprecated: use SSLInsecureSkipVerify instead.

TemporalStorageHandler

TemporalStorageHandler is a storage manager that uses non data-persistent databases, like Redis.

Field name Field type Comment
Config

*TemporalStorageConfig

No comment on field.
kv

model.KeyValue

No comment on field.
list

model.List

No comment on field.
forceReconnect

bool

No comment on field.

Functions

func NewTemporalStorageHandler

Uses: fmt.Errorf, mapstructure.Decode.

func (*EnvMapString) Decode

Uses: strings.Split.

func (*TemporalStorageHandler) GetAndDeleteSet

Uses: logrus.Fields.

func (*TemporalStorageHandler) GetName

func (*TemporalStorageHandler) Init

Uses: envconfig.Process, logrus.Fields.

func (*TemporalStorageHandler) SetKey

SetKey will create (or update) a key value in the store

Uses: time.Duration, time.Second.

Private functions

func createConnector

References: connector.NewConnector, keyvalue.NewKeyValue, list.NewList, model.RedisV9Type, model.WithRedisConfig, model.WithTLS.

func getKVFromConnector

References: keyvalue.NewKeyValue.

func getListFromConnector

References: list.NewList.

func connect

Connect will establish a connection to the r.db

References: fmt.Errorf, logrus.Fields.

func ensureConnection

References: fmt.Errorf, retry.GetTemporalStorageExponentialBackoff.

func fixKey

References: logrus.Fields.

func resetConnection

References: fmt.Errorf, logrus.Fields, model.RedisOptions, model.TLS.


Tests

Files: 1. Third party imports: 1. Imports from organisation: 1. Tests: 6. Benchmarks: 0.

Vars

Test functions

TestNewTemporalClusterStorageHandler

References: assert.Equal, assert.Error, assert.NoError, assert.NotNil, context.Background, model.RedisV9Type, testing.T.

TestRedisClusterStorageManager_GetAndDeleteSet

References: fmt.Sprintf, testing.T, time.Second.

TestTemporalStorageHandler_GetName

TestTemporalStorageHandler_Init

References: assert.Equal, assert.Error, assert.NoError, assert.NotNil, context.Background, errors.New, model.RedisV9Type, testing.T.

TestTemporalStorageHandler_SetKey

TestTemporalStorageHandler_ensureConnection

References: assert.NoError, assert.NotNil, testing.T.