p

zio

webhooks

package webhooks

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. webhooks
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package backends

Type Members

  1. type SerializePayload = (WebhookPayload, Option[WebhookContentMimeType]) => String

    SerializePayload is a function that takes a WebhookPayload and an optional [WebhookContentMimeType] and serializes it into a String.

  2. final case class Webhook(id: WebhookId, url: String, label: String, status: WebhookStatus, deliveryMode: WebhookDeliveryMode) extends Product with Serializable

    A Webhook represents a webhook (a web callback registered to receive notifications), and contains an id, a URL, a label (used for diagnostic purposes), a status, and a delivery mode.

  3. final case class WebhookContentMimeType(value: String) extends Product with Serializable

    A WebhookContentMimeType contains the MIME type that should describe the content of a WebhookEvent or a WebhookDispatch which contains a non-empty set of WebhookEvents.

  4. sealed trait WebhookDeliveryBatching extends Product with Serializable

    Webhook delivery comes in two modes: Single or Batched delivery.

    Webhook delivery comes in two modes: Single or Batched delivery. Single indicates that each WebhookEvent is delivered in one HTTP call. Conversely, Batched indicates delivery of some batch of WebhookEvents in one HTTP call for communication efficiency.

  5. final case class WebhookDeliveryMode extends Product with Serializable

    A WebhookDeliveryMode specifies two aspects of webhook delivery: WebhookDeliveryBatching, whether the delivery of events is done one-by-one or in batches; and WebhookDeliverySemantics, which specify a delivery goal of at-least-once, or at-most-once.

  6. sealed trait WebhookDeliverySemantics extends AnyRef

    WebhookDeliverySemantics specify the delivery goal of a Webhook.

    WebhookDeliverySemantics specify the delivery goal of a Webhook. If we deliver AtLeastOnce, we have to ensure reliable delivery of a WebhookEvent by retrying even though it may result in message duplication. AtMostOnce indicates delivery can fail, but cannot be done more than once.

  7. sealed trait WebhookError extends Exception with Product with Serializable

    Represents errors that can be raised during the operation of a webhook server.

  8. final case class WebhookEvent(key: WebhookEventKey, status: WebhookEventStatus, content: String, headers: Chunk[(String, String)]) extends Product with Serializable

    A WebhookEvent stores the content of a webhook event.

  9. final case class WebhookEventId(value: Long) extends Product with Serializable

    A WebhookEvent is identified by its WebhookEventId, represented as a Long.

  10. final case class WebhookEventKey(eventId: WebhookEventId, webhookId: WebhookId) extends Product with Serializable

    A WebhookEventKey represents a composite key that uniquely identifies a WebhookEvent with respect to the Webhook it belongs to.

  11. trait WebhookEventRepo extends AnyRef

    A WebhookEventRepo provides persistence facilities for webhook events.

  12. sealed trait WebhookEventStatus extends Product with Serializable

    A WebhookEventStatus denotes the lifecycle of a WebhookEvent.

    A WebhookEventStatus denotes the lifecycle of a WebhookEvent. Upon creation, an event is New. On WebhookServer startup, events that are being delivered or retried are marked Delivering. Once the dispatcher gets back a 200 success from the endpoint, the event is marked Delivered. If retries for a webhook times out, we mark all events under that webhook Failed.

  13. trait WebhookHttpClient extends AnyRef

    A WebhookHttpClient lets webhooks post data over HTTP.

  14. final case class WebhookHttpRequest extends Product with Serializable

    A WebhookHttpRequest contains a subset of an HTTP request required to send webhook data.

  15. final case class WebhookHttpResponse extends Product with Serializable

    A WebhookHttpResponse contains a statusCode, the only HTTP response data relevant to webhook delivery.

  16. final case class WebhookId(value: Long) extends Product with Serializable

    A webhook is identified by a Long.

  17. sealed trait WebhookPayload extends AnyRef
  18. trait WebhookRepo extends AnyRef

    A WebhookRepo provides persistence facilities for webhooks.

  19. final class WebhookServer extends AnyRef

    A WebhookServer is a stateful server that subscribes to WebhookEvents and reliably delivers them, i.e.

    A WebhookServer is a stateful server that subscribes to WebhookEvents and reliably delivers them, i.e. failed dispatches are retried once, followed by retries with exponential backoff. Retries are performed until some duration after which webhooks will be marked WebhookStatus.Unavailable since some Instant. Dispatches are batched if and only if a batching capacity is configured and a webhook's delivery batching is WebhookDeliveryBatching.Batched. When shutdown is called, a shutdownSignal is sent which lets all dispatching work finish. Finally, the retry state is persisted, which allows retries to resume after server restarts.

    A live server layer is provided in the companion object for convenience and proper resource management, ensuring shutdown is called by the finalizer.

  20. final case class WebhookServerConfig(errorSlidingCapacity: Int, maxRequestsInFlight: Int, retry: Retry, batchingCapacity: Option[Int], webhookQueueCapacity: Int) extends Product with Serializable

    A WebhookServerConfig contains configuration settings for a WebhookServer's error hub capacity, retrying, and batching.

    A WebhookServerConfig contains configuration settings for a WebhookServer's error hub capacity, retrying, and batching. For optimal performance, use capacities that are powers of 2.

    errorSlidingCapacity

    Number of errors to keep in the sliding buffer

    maxRequestsInFlight

    Max number of requests allowed at any given time

    retry

    Configuration settings for retries

    batchingCapacity

    Optional capacity for each batch. Set this to enable batching.

  21. trait WebhookStateRepo extends AnyRef

    A WebhookStateRepo stores encoded server state, allowing the WebhookServer state to suspend and continue after restarting.

    A WebhookStateRepo stores encoded server state, allowing the WebhookServer state to suspend and continue after restarting.

    For ease of integration, this state is modeled as a string.

  22. sealed trait WebhookStatus extends Product with Serializable

    A WebhookStatus describes the status of a webhook, which can be Enabled, Disabled, or Unavailable: the last one being so since some Instant.

    A WebhookStatus describes the status of a webhook, which can be Enabled, Disabled, or Unavailable: the last one being so since some Instant. Clients are responsible for enabling and disabling webhooks as this is a read-only status as far as the webhook server is concerned. The server sets a webhook unavailable when retries time out.

  23. sealed trait WebhookUpdate extends AnyRef

    A WebhookUpdate represents the removal of or a change to a Webhook.

    A WebhookUpdate represents the removal of or a change to a Webhook. A WebhookServer can subscribe to these to incrementally update its internal webhook map.

  24. final case class WebhooksProxy extends Product with Serializable

    Mediates access to Webhooks, caching webhooks in memory while keeping them updated by polling for some interval or with a subscription.

Value Members

  1. case object BuildInfo extends Product with Serializable

    This object was generated by sbt-buildinfo.

  2. object WebhookDeliveryBatching extends Serializable
  3. object WebhookDeliveryMode extends Serializable
  4. object WebhookDeliverySemantics
  5. object WebhookError extends Serializable
  6. object WebhookEventId extends Serializable
  7. object WebhookEventKey extends Serializable
  8. object WebhookEventStatus extends Serializable
  9. object WebhookHttpClient
  10. object WebhookId extends Serializable
  11. object WebhookPayload
  12. object WebhookServer
  13. object WebhookServerConfig extends Serializable
  14. object WebhookStateRepo
  15. object WebhookStatus extends Serializable
  16. object WebhookUpdate
  17. object WebhooksProxy extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped