| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Config.QueueTarget
Description
Derive the mirror-queue backend from the queue URL's own shape, once at load (mkQueueUrl).
The queue URL is the single source of truth for which backend carries the mirror jobs, the same
derivation the mirror-write credential follows (Ecluse.Config.Target). An SQS queue URL
(https://sqs.{region}.amazonaws.com/{account}/{queue}) names the SQS backend and carries its
region, and a Pub/Sub topic resource (projects/{project}/topics/{topic}) names the GCP one. No
separate backend selector exists to disagree with the URL.
Synopsis
- data QueueTarget
- data QueueUrl
- queueUrlText :: QueueUrl -> Text
- queueUrlTarget :: QueueUrl -> Maybe QueueTarget
- mkQueueUrl :: Text -> Text -> Either Text QueueUrl
- parseQueueTarget :: Text -> Maybe QueueTarget
Documentation
data QueueTarget Source #
A recognised mirror-queue destination, parsed from the queue URL's shape.
Constructors
| SqsTarget Text | An SQS queue URL, carrying the region parsed from its host. |
| PubSubTarget Text Text | A Pub/Sub topic resource, carrying its project and topic. |
Instances
| Show QueueTarget Source # | |
Defined in Ecluse.Config.Queue.Internal Methods showsPrec :: Int -> QueueTarget -> ShowS # show :: QueueTarget -> String # showList :: [QueueTarget] -> ShowS # | |
| Eq QueueTarget Source # | |
Defined in Ecluse.Config.Queue.Internal | |
queue.url as parsed at load (mkQueueUrl): the value as written,
with the backend its shape names, or no backend when only the SQS endpoint override can dial it.
queueUrlText :: QueueUrl -> Text Source #
The value as written, trimmed.
queueUrlTarget :: QueueUrl -> Maybe QueueTarget Source #
The backend the value's shape names, Nothing when it names none.
mkQueueUrl :: Text -> Text -> Either Text QueueUrl Source #
Build the QueueUrl a queue.url key resolves to, the key naming every refusal. A shape
naming no backend is carried, not refused: the SQS endpoint override dials one that matches none.
parseQueueTarget :: Text -> Maybe QueueTarget Source #
Parse a queue URL into the backend it names, or Nothing when it names neither. The SQS form
is exact, and a nearly-but-not SQS URL is a transcription error to surface, never to repair.