Liking cljdoc? Tell your friends :D

wagoe.webhooks.ports

Outbound webhooks: where subscriptions live, where attempts are recorded, how a request leaves the process, and what the rest of an application calls.

Outbound webhooks: where subscriptions live, where attempts are recorded,
how a request leaves the process, and what the rest of an application calls.
raw docstring

IDeliveryLogcljprotocol

One row per delivery attempt.

One row per delivery attempt.

attempt-countclj

(attempt-count this subscription-id event-id)

How many attempts were recorded for this subscription and event.

How many attempts were recorded for this subscription and event.

list-attemptsclj

(list-attempts this opts)

Attempts, newest first. opts may carry :subscription-id, :event-id, :limit and :offset.

Attempts, newest first. `opts` may carry `:subscription-id`, `:event-id`,
`:limit` and `:offset`.

record-attempt!clj

(record-attempt! this attempt)

Insert attempt. Returns it.

Insert `attempt`. Returns it.
sourceraw docstring

ISubscriptionStorecljprotocol

Webhook subscriptions. :secret is stored as given; the service encrypts it before it gets here.

Webhook subscriptions. `:secret` is stored as given; the service encrypts it
before it gets here.

candidate-subscriptionsclj

(candidate-subscriptions this tenant-id)

Active subscriptions that may receive an event of tenant-id: the tenant's own and those with no tenant. nil tenant-id gives only the latter.

Active subscriptions that may receive an event of `tenant-id`: the tenant's
own and those with no tenant. nil `tenant-id` gives only the latter.

delete-subscription!clj

(delete-subscription! this id)

Delete subscription id. True when one was deleted.

Delete subscription `id`. True when one was deleted.

find-subscriptionclj

(find-subscription this id)

Subscription id, or nil.

Subscription `id`, or nil.

list-subscriptionsclj

(list-subscriptions this opts)

Subscriptions, newest first. opts may carry :tenant-id (only that tenant's), :active?, :limit and :offset.

Subscriptions, newest first. `opts` may carry `:tenant-id` (only that
tenant's), `:active?`, `:limit` and `:offset`.

save-subscription!clj

(save-subscription! this subscription)

Insert subscription, a map with :id. Returns it.

Insert `subscription`, a map with `:id`. Returns it.

update-subscription!clj

(update-subscription! this id changes)

Apply changes to subscription id. Returns the updated subscription, or nil when there is none.

Apply `changes` to subscription `id`. Returns the updated subscription, or
nil when there is none.
sourceraw docstring

IWebhookscljprotocol

The module's API.

The module's API.

change-subscription!clj

(change-subscription! this id changes)

Change :url, :event-pattern, :active? or :description. Returns the subscription, nil when absent, or {:error ...}.

Change `:url`, `:event-pattern`, `:active?` or `:description`. Returns
the subscription, nil when absent, or `{:error ...}`.

create-subscription!clj

(create-subscription! this input)

Validate and store a subscription. input: :url, :event-pattern, and optionally :tenant-id, :description, :secret. Returns {:subscription s :secret plaintext} — the only time the secret is returned — or {:error {:type :validation-error ...}}.

Validate and store a subscription. `input`: `:url`, `:event-pattern`, and
optionally `:tenant-id`, `:description`, `:secret`. Returns
`{:subscription s :secret plaintext}` — the only time the secret is
returned — or `{:error {:type :validation-error ...}}`.

deliver!clj

(deliver! this args)

Make one delivery attempt from a job's args. Returns a jobs handler result: {:success? true ...} or {:success? false :error ...}, which the queue retries.

Make one delivery attempt from a job's args. Returns a jobs handler
result: `{:success? true ...}` or `{:success? false :error ...}`, which
the queue retries.

dispatch!clj

(dispatch! this topic event)

Enqueue one delivery job per subscription that matches topic and the event's tenant. Returns the number enqueued.

Enqueue one delivery job per subscription that matches `topic` and the
event's tenant. Returns the number enqueued.

remove-subscription!clj

(remove-subscription! this id)

Delete a subscription. True when one was deleted.

Delete a subscription. True when one was deleted.

subscriptionsclj

(subscriptions this opts)

As list-subscriptions, without secrets.

As `list-subscriptions`, without secrets.
sourceraw docstring

IWebhookTransportcljprotocol

Send one HTTP request.

Send one HTTP request.

send-request!clj

(send-request! this request)

POST request — {:url :headers :body}, and :addresses to connect to those InetAddresses instead of resolving the host — and return {:status int :body string :latency-ms long}, or {:error {:type kw :message string} :latency-ms long} when no response arrived. Never follows a redirect.

POST `request` — `{:url :headers :body}`, and `:addresses` to connect to
those InetAddresses instead of resolving the host — and return
`{:status int :body string :latency-ms long}`, or
`{:error {:type kw :message string} :latency-ms long}` when no response
arrived. Never follows a redirect.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close