ecluse
Safe HaskellNone
LanguageGHC2021

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

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

Instances details
Show QueueTarget Source # 
Instance details

Defined in Ecluse.Config.Queue.Internal

Eq QueueTarget Source # 
Instance details

Defined in Ecluse.Config.Queue.Internal

data QueueUrl Source #

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.

Instances

Instances details
Show QueueUrl Source # 
Instance details

Defined in Ecluse.Config.Queue.Internal

Eq QueueUrl Source # 
Instance details

Defined in Ecluse.Config.Queue.Internal

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.