Documentation
¶
Overview ¶
Package orders is a reference integration, not a service dependency or SDK.
Index ¶
- Variables
- func Create(ctx context.Context, pool *pgxpool.Pool, event Created, endpointID string, ...) error
- func Receiver(pool *pgxpool.Pool, secret []byte, now func() time.Time) http.Handler
- func ReceiverWithKeys(pool *pgxpool.Pool, keys [][]byte, now func() time.Time) http.Handler
- type Created
- type Publisher
Constants ¶
This section is empty.
Variables ¶
var ErrBusinessConflict = errors.New("business event identity conflicts with processed body")
var ErrPublish = errors.New("outbox submission not acknowledged")
var Schema string
Schema belongs to the example application, never the delivery schema.
Functions ¶
func Create ¶
func Create(ctx context.Context, pool *pgxpool.Pool, event Created, endpointID string, now time.Time) error
Create commits the business change and immutable outgoing bytes together. Generate the two UUIDs once before calling; persist no credentials in outbox.
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func NewPublisher ¶
NewPublisher accepts a deployment-controlled API origin, never event input. Call PublishOne periodically. A five-second persisted delay bounds retries.
func (*Publisher) PublishOne ¶
PublishOne sends one pending row without holding a transaction across HTTP. Concurrent publishers can submit the same row: API idempotency makes that safe. This deliberately favors a small reference over a second queue engine.