redis

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counters

type Counters struct {
	Client *goredis.Client
	Now    func() time.Time // optional; defaults to time.Now
}

Counters implements dataplane.CounterStore with fixed-window buckets in Redis. Used for minute / hour / day rate limits. Lifetime (total) quotas stay on Postgres.

func (*Counters) Get

func (c *Counters) Get(ctx context.Context, scopeType, scopeID, metric, window string) (int64, error)

func (*Counters) Incr

func (c *Counters) Incr(ctx context.Context, scopeType, scopeID, metric, window string, delta int64) (int64, error)

type SSOStateStore

type SSOStateStore struct {
	Client *goredis.Client
	TTL    time.Duration
	Now    func() time.Time
}

SSOStateStore stores SSO CSRF state in Redis for multi-node control planes.

func NewSSOStateStore

func NewSSOStateStore(client *goredis.Client, ttl time.Duration) *SSOStateStore

func (*SSOStateStore) Put

func (s *SSOStateStore) Put(ctx context.Context, state string, value identity.SSOState) error

func (*SSOStateStore) Take

func (s *SSOStateStore) Take(ctx context.Context, state string) (identity.SSOState, error)

Jump to

Keyboard shortcuts

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