idempotency

package
v1.1.59 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct{}

Generator generates idempotency keys

func NewGenerator

func NewGenerator() *Generator

NewGenerator creates a new idempotency key generator

func (*Generator) GenerateKey

func (g *Generator) GenerateKey(scope Scope, params map[string]interface{}) string

GenerateKey generates an idempotency key from a scope and parameters

func (*Generator) ValidateKey

func (g *Generator) ValidateKey(scope Scope, params map[string]interface{}, key string) bool

ValidateKey validates if an idempotency key matches expected parameters

type Scope

type Scope string

Scope represents the scope of idempotency

const (
	ScopeSubscriptionInvoice Scope = "subscription_invoice"
	ScopeOneOffInvoice       Scope = "one_off_invoice"

	// Credit Grant
	ScopeCreditGrant Scope = "credit_grant"

	// Payment
	ScopePayment Scope = "payment"

	// Credit note
	ScopeCreditNote Scope = "credit_note"

	// Tax Application
	ScopeTaxApplication Scope = "tax_application"

	// Wallet Top Up
	ScopeWalletTopUp Scope = "wallet_top_up"
)

Jump to

Keyboard shortcuts

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