Documentation
¶
Index ¶
- Constants
- type Dialect
- type Option
- type Store
- func (s *Store) Acquire(ctx context.Context, key string, ttl time.Duration) (idempotency.Record, bool, error)
- func (s *Store) Cleanup(ctx context.Context) error
- func (s *Store) Delete(ctx context.Context, key string) error
- func (s *Store) Get(ctx context.Context, key string) (idempotency.Record, bool, error)
- func (s *Store) Migrate(ctx context.Context) error
- func (s *Store) Update(ctx context.Context, key string, update idempotency.Update) error
Constants ¶
View Source
const ( DialectPostgres = sqlutil.DialectPostgres DialectSQLite = sqlutil.DialectSQLite )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Store)
Option configures the postgres idempotency store.
func WithDialect ¶
WithDialect sets the SQL placeholder style.
func WithUseForUpdate ¶
WithUseForUpdate toggles row locking in transactions.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements idempotency.Store backed by SQL.
func (*Store) Acquire ¶
func (s *Store) Acquire(ctx context.Context, key string, ttl time.Duration) (idempotency.Record, bool, error)
Acquire creates or returns an existing record.
Click to show internal directories.
Click to hide internal directories.