redisprovider

package
v0.7.9 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

pkg/provider/redis/provider.go

Redis provider for Orkestra.

Handles the "cache" block in Katalog declarations. Uses go-redis/v9 — the standard Redis client for Go.

Supported resource kinds:

acluser — Redis ACL user (create, update password and rules, delete)
config  — Redis server configuration (SET and persist across restarts via CONFIG SET)

Installation:

go get github.com/redis/go-redis/v9

Registration:

p, err := cacheprovider.NewFromAuth(ctx, auth)
registry.Register(p)

Auth keys (providers[].auth block):

addr     — server address as host:port (default: localhost:6379)
password — server password / default user password (default: empty)
db       — logical database index (default: 0)
tls      — "true" to enable TLS (default: false)

Katalog:

providers:
  - name: cache
    required: true
    auth:
      addr: "$REDIS_ADDR"
      password: "$REDIS_PASSWORD"

operatorBox:
  providers:
    cache:
      - acluser:
          name: "{{ .spec.cacheUser }}"
          password: "{{ .spec.cachePassword }}"
          rules: "~* &* +@all"
          credentials:
            secretName: "{{ .metadata.name }}-cache-creds"   # REDIS_PASSWORD key

      - config:
          key: maxmemory-policy
          value: allkeys-lru

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider implements orktypes.Provider for the "cache" block.

func New

func New(client *redis.Client) *Provider

New creates a Redis cache provider from an existing client.

func NewFromAddr

func NewFromAddr(ctx context.Context, addr, password string, db int) (*Provider, error)

NewFromAddr creates a Redis provider from an address and optional password.

func NewFromAuth

func NewFromAuth(ctx context.Context, auth map[string]string) (*Provider, error)

NewFromAuth creates a Redis provider from a Katalog auth map. Keys: addr, password, db, tls.

func (*Provider) Delete

func (p *Provider) Delete(ctx context.Context, req orktypes.DeleteRequest) error

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Reconcile

func (p *Provider) Reconcile(ctx context.Context, req orktypes.ReconcileRequest) error

Jump to

Keyboard shortcuts

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