Documentation
¶
Index ¶
- type MySQL
- func (s *MySQL) Add(ctx context.Context, exec txoutbox.Executor, msg txoutbox.Message) error
- func (s *MySQL) Claim(ctx context.Context, workerID string, limit int, leaseTTL time.Duration) ([]txoutbox.Envelope, error)
- func (s *MySQL) Fail(ctx context.Context, id int64, retryCount int) error
- func (s *MySQL) Retry(ctx context.Context, id int64, retryCount int, nextRetry time.Time) error
- func (s *MySQL) Send(ctx context.Context, id int64, sendAt time.Time) error
- type MySQLOption
- type Postgres
- func (s *Postgres) Add(ctx context.Context, exec txoutbox.Executor, msg txoutbox.Message) error
- func (s *Postgres) Claim(ctx context.Context, workerID string, limit int, leaseTTL time.Duration) ([]txoutbox.Envelope, error)
- func (s *Postgres) Fail(ctx context.Context, id int64, retryCount int) error
- func (s *Postgres) Retry(ctx context.Context, id int64, retryCount int, nextRetry time.Time) error
- func (s *Postgres) Send(ctx context.Context, id int64, sendAt time.Time) error
- type PostgresOption
- type SQLite
- func (s *SQLite) Add(ctx context.Context, exec txoutbox.Executor, msg txoutbox.Message) error
- func (s *SQLite) Claim(ctx context.Context, workerID string, limit int, leaseTTL time.Duration) ([]txoutbox.Envelope, error)
- func (s *SQLite) Fail(ctx context.Context, id int64, retryCount int) error
- func (s *SQLite) Retry(ctx context.Context, id int64, retryCount int, nextRetry time.Time) error
- func (s *SQLite) Send(ctx context.Context, id int64, sendAt time.Time) error
- type SQLiteOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
type MySQLOption ¶
type MySQLOption func(*MySQL)
func WithMySQLNow ¶
func WithMySQLNow(now func() time.Time) MySQLOption
func WithMySQLTable ¶
func WithMySQLTable(table string) MySQLOption
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func NewPostgres ¶
func NewPostgres(db *sql.DB, opts ...PostgresOption) *Postgres
type PostgresOption ¶
type PostgresOption func(*Postgres)
func WithPostgresNow ¶
func WithPostgresNow(now func() time.Time) PostgresOption
func WithPostgresTable ¶
func WithPostgresTable(table string) PostgresOption
type SQLite ¶
type SQLite struct {
// contains filtered or unexported fields
}
SQLite implements Store for SQLite databases.
func NewSQLite ¶
func NewSQLite(db *sql.DB, opts ...SQLiteOption) *SQLite
NewSQLite creates a Store backed by SQLite.
func (*SQLite) Claim ¶
func (s *SQLite) Claim(ctx context.Context, workerID string, limit int, leaseTTL time.Duration) ([]txoutbox.Envelope, error)
Claim leases up to limit rows for the given worker.
type SQLiteOption ¶
type SQLiteOption func(*SQLite)
SQLiteOption configures a SQLite.
func WithSQLiteNow ¶
func WithSQLiteNow(now func() time.Time) SQLiteOption
WithSQLiteNow overrides the clock used for Lease timestamps.
func WithSQLiteTable ¶
func WithSQLiteTable(name string) SQLiteOption
WithSQLiteTable overrides the default table name ("txoutbox").
Click to show internal directories.
Click to hide internal directories.