Documentation
¶
Overview ¶
Package memory provides an in-memory storage implementation for idempotency records.
This storage is suitable for development, testing, and single-instance applications. For production distributed systems, use Redis or PostgreSQL storage instead.
Index ¶
- type Storage
- func (s *Storage) Close() error
- func (s *Storage) Delete(ctx context.Context, key string) error
- func (s *Storage) Exists(ctx context.Context, key string) (bool, error)
- func (s *Storage) Get(ctx context.Context, key string) (*idempotency.Record, error)
- func (s *Storage) Set(ctx context.Context, record *idempotency.Record, ttl time.Duration) error
- func (s *Storage) TryLock(ctx context.Context, key string, ttl time.Duration) (bool, error)
- func (s *Storage) Unlock(ctx context.Context, key string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is an in-memory implementation of idempotency.Storage
func NewMemoryStorage ¶
func NewMemoryStorage() *Storage
NewMemoryStorage creates a new in-memory storage instance
Click to show internal directories.
Click to hide internal directories.