Files
feedkit/sinks/sink.go
Eric Rakestraw 0cc2862170 feedkit: split the former maximumdirect.net/weatherd project in two.
feedkit now contains a reusable core, while weatherfeeder is a concrete implementation that includes weather-specific functions.
2026-01-13 10:40:01 -06:00

17 lines
402 B
Go

package sinks
import (
"context"
"gitea.maximumdirect.net/ejr/feedkit/event"
)
// Sink is an adapter that consumes a stream of domain-agnostic events.
//
// Sinks MUST respect ctx.Done() whenever they do I/O or blocking work.
// (Fanout timeouts only help if the sink cooperates with context cancellation.)
type Sink interface {
Name() string
Consume(ctx context.Context, e event.Event) error
}