gateway

package
v0.54.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package gateway holds what every Brigade gateway shares: the harness-name prefix that marks a session as a gateway.

Index

Constants

View Source
const (
	HarnessSlack   = HarnessPrefix + "slack"
	HarnessEmail   = HarnessPrefix + "email"
	HarnessWebhook = HarnessPrefix + "webhook"
)

The harness names of the gateways Brigade knows: the two hosted ones and the self-hosted webhook gateway. The manager digest (card 162) finds the Slack and mail gateways on the roster by these.

View Source
const HarnessPrefix = "gateway-"

HarnessPrefix marks a gateway's harness name: the hosted mail and Slack gateways ("gateway-email", "gateway-slack") and the self-hosted webhook gateway ("gateway-webhook"). It is not a wire rule (`harness` is free text and protocol.Validate says nothing about this prefix), so it lives outside the frozen internal/protocol, but it is the single Go spelling every consumer agrees on: a gateway is left off the rosters shown to people and is never the session a `--member` message is routed to. The Edge Functions keep their own copy of the prefix (supabase/functions/_shared/gateway.ts).

Variables

This section is empty.

Functions

func IsHarness

func IsHarness(harness string) bool

IsHarness reports whether a harness name is a gateway's.

func IsRelayed added in v0.49.0

func IsRelayed(body string) bool

IsRelayed reports whether a message body opens the way a gateway opens a message it relays for a person or an outside service (card 242). The envelope names no harness, so this is the one thing a receiver can tell a relayed message by, and it holds in the direction that matters: the gateway writes the line itself, before the text it was given, so whoever wrote that text cannot remove it. A teammate's session can write the same words at the top of a body of its own; that only makes its message count as relayed, which is why `brigade send --invite` refuses such a body. The match is the opening alone, on purpose, and never the rest of the line: a sender's name can carry a character that ends the line early, and a rule that read to the line's end would then miss the gateway's own message. A body that merely begins this way is treated as relayed, never the other way round.

Types

This section is empty.

Directories

Path Synopsis
Package webhook is the Brigade webhook gateway: an ordinary team member that forwards its inbox to an HTTPS endpoint and turns signed HTTP POSTs back into Brigade messages.
Package webhook is the Brigade webhook gateway: an ordinary team member that forwards its inbox to an HTTPS endpoint and turns signed HTTP POSTs back into Brigade messages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL