feat: edge gateway service

This commit is contained in:
Ilia Denisov
2026-04-02 19:18:42 +02:00
committed by GitHub
parent 8cde99936c
commit 436c97a38b
95 changed files with 20504 additions and 57 deletions
+24
View File
@@ -0,0 +1,24 @@
// Package replay defines the authenticated replay-reservation contract used by
// the gateway transport pipeline.
package replay
import (
"context"
"errors"
"time"
)
var (
// ErrDuplicate reports that the request identifier has already been
// reserved for the same device session within the active replay window.
ErrDuplicate = errors.New("replay reservation already exists")
)
// Store reserves authenticated transport request identifiers for a bounded
// replay window.
type Store interface {
// Reserve marks the deviceSessionID and requestID pair as seen for ttl.
// Implementations must wrap ErrDuplicate when the same pair is reserved
// again before ttl expires.
Reserve(ctx context.Context, deviceSessionID string, requestID string, ttl time.Duration) error
}