idempotency

package
v0.0.0-...-8ffcee5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyConnected = errors.New("IDEMPOTENCY.ALREADY_CONNECTED.ERROR")
	ErrNotConnected     = errors.New("IDEMPOTENCY.NOT_CONNECTED.ERROR")
	ErrConflict         = errors.New("IDEMPOTENCY.CONFLICT.ERROR")
	ErrKeyEmpty         = errors.New("IDEMPOTENCY.KEY.EMPTY.ERROR")
)
View Source
var CtxKey ctxkey = "idempotency.key"

Functions

func Key

func Key(k string) (string, error)

Types

type Idempotency

type Idempotency interface {
	patterns.Connectable
	Validate(ctx context.Context, key string) error
}

func New

func New(conf *config.Config) (Idempotency, error)

New creates a new idempotency instance based on the provided configuration. The idempotency instance is initialized based on the URI scheme. Supported schemes are: - memory:// - redis:// If the URI scheme is not supported, an error is returned.

func NewRedis

func NewRedis(conf *config.Config) (Idempotency, error)

NewRedis creates a new idempotency instance that uses Redis as the underlying storage.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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