Documentation
¶
Overview ¶
Package source is the chassis `source` inlet: a per-period poll loop that claims due external-source watchers from the tenant_sources runtime table (chassis/source), opens each (a remote IMAP mailbox today), reads what is new past the source's durable cursor, fires each item into the source's `<stack>/_source/0`, and — once an item's run succeeds — acknowledges it at the source (marks it read, or moves it aside). It is the outbound mirror of the LMTP inlet: mail the tenant already receives elsewhere, pulled in without changing their MX or forwarding.
Coordination is the CLAIM, exactly as the scheduled inlet: one conditional UPDATE flips a due source idle→claimed and RETURNING says "I won", so a single fleet node polls a given mailbox per cycle even when several nodes share the runtime DB. There is no leader election.
The mailbox credential is materialized from the encrypted secret store inside the claim, handed to the connection's Open, and zeroed the instant Open returns — it is never stored on a struct, and the SecretBag machinery keeps it out of every envelope, trace, and log by construction.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the source inlet. It satisfies the Start()/Stop() contract.
func NewController ¶
func NewController(ctx context.Context, pu *processor.Unit, store *src.Store, guard egress.Guard) *Controller
NewController builds the source controller around the runtime-DB source store and the egress guard. A nil store (source personality inactive) yields an inert controller whose Start is a no-op.
func (*Controller) Start ¶
func (c *Controller) Start()
Start launches the poll loop. No-op when the source personality is disabled or no store was opened.
func (*Controller) Stop ¶
func (c *Controller) Stop()