idempotency

package
v0.0.0-...-d386c04 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotConnected     = errors.New("INFRASTRUCTURE.IDEMPOTENCY.NOT_CONNECTED.ERROR")
	ErrAlreadyConnected = errors.New("INFRASTRUCTURE.IDEMPOTENCY.ALREADY_CONNECTED.ERROR")
)

Functions

func Key

func Key(key string) string

Types

type Config

type Config struct {
	Uri        string `json:"uri" yaml:"uri" mapstructure:"uri"`
	TimeToLive uint64 `json:"time_to_live" yaml:"timeToLive" mapstructure:"time_to_live"`
}

func (*Config) Validate

func (conf *Config) Validate() error

type Idempotency

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

func New

func New(conf *Config, logger logging.Logger) (Idempotency, error)

func NewRedis

func NewRedis(conf *Config, logger logging.Logger) (Idempotency, error)

Jump to

Keyboard shortcuts

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