Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryReplayProtector ¶
type MemoryReplayProtector struct {
// contains filtered or unexported fields
}
MemoryReplayProtector backed by memory using a map.
type RedisReplayProtector ¶
RedisReplayProtector backed by Redis.
type ReplayProtector ¶
type ReplayProtector interface {
// FirstSeen returns true on first observation, false if seen before.
FirstSeen(ctx context.Context, key string, ttl time.Duration) (bool, error)
}
ReplayProtector prevents state/nonce reuse. FirstSeen returns true on first observation, false if seen before.
func NewMemoryReplayProtector ¶
func NewMemoryReplayProtector() ReplayProtector
NewMemoryReplayProtector creates a new MemoryReplayProtector.
func NewRedisReplayProtector ¶
func NewRedisReplayProtector(client *redis.Client, prefix string) ReplayProtector
NewRedisReplayProtector creates a new RedisReplayProtector.
Click to show internal directories.
Click to hide internal directories.