idempotencyredis

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package idempotencyredis provides Redis-backed idempotency storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	KeyPrefix string
}

Options configures Redis-backed idempotency storage.

type Store

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

Store implements ports.IdempotencyStore using Redis.

func New

func New(client redis.UniversalClient, opts Options) *Store

New constructs a Redis-backed idempotency store.

func (*Store) Get

Get returns an idempotency record if present.

func (*Store) Save

func (s *Store) Save(ctx context.Context, key string, record ports.IdempotencyRecord, ttl time.Duration) error

Save persists a completed idempotency record.

func (*Store) TryBegin

func (s *Store) TryBegin(ctx context.Context, key string, record ports.IdempotencyRecord, ttl time.Duration) (bool, error)

TryBegin reserves a key for an in-flight request.

Jump to

Keyboard shortcuts

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