Documentation
¶
Overview ¶
Package publish fans output to destinations (GitHub issue, Slack, Discord, Teams), isolating per-destination failures.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
Dispatcher fans destinations out to their respective Publishers in parallel, preserving input order in the returned Results slice.
func (*Dispatcher) Dispatch ¶
func (d *Dispatcher) Dispatch(ctx context.Context, dests []config.Destination, outputFor func(config.Destination) string, tctx template.Context, secrets SecretGetter, runSucceeded bool) []Result
Dispatch publishes output to each destination concurrently, skipping destinations whose `when` condition doesn't match runSucceeded. outputFor is called per-destination to select the right output string. Skipped destinations produce a Result with Skipped=true and OK=true.
type Publisher ¶
type Publisher interface {
Type() string
Publish(ctx context.Context, dest config.Destination, output string, tctx template.Context, secrets SecretGetter) Result
}
Publisher publishes a rendered output to a single destination. Implementations resolve their own secrets (via SecretGetter) and handle their own retries.
func NewDiscordPublisher ¶
func NewDiscordPublisher() Publisher
NewDiscordPublisher returns a Publisher that posts messages to Discord incoming webhooks. The webhook URL is resolved from the destination's Secret via the SecretGetter.
func NewEmailPublisher ¶
func NewEmailPublisher() Publisher
NewEmailPublisher returns a Publisher that sends email via SMTP.
func NewGitHubIssuePublisher ¶
NewGitHubIssuePublisher constructs the publisher. The token is looked up via SecretGetter using the reserved name "github_token"; if unavailable, fallbackToken is used (P1: passed through env; P2 will swap for a GitHub App installation token).
func NewHTTPPublisher ¶
func NewHTTPPublisher() Publisher
NewHTTPPublisher returns a Publisher that POSTs (or uses the configured method) to an arbitrary HTTP endpoint.
func NewSlackPublisher ¶
func NewSlackPublisher() Publisher
NewSlackPublisher returns a Publisher that posts messages to Slack incoming webhooks. The webhook URL is resolved from the destination's Secret via the SecretGetter.
func NewTeamsPublisher ¶
func NewTeamsPublisher() Publisher
NewTeamsPublisher returns a Publisher that posts Adaptive Cards to a Teams webhook (configured via Power Automate's "When a Teams webhook request is received" trigger).
type Result ¶
type Result struct {
Type string // "github-issue" | "slack" | "discord" | "teams"
OK bool
Skipped bool // true when the destination's when-condition was not met
SkipReason string // human-readable explanation when Skipped==true
Err error // non-nil when OK == false
Detail string // optional context (issue URL, HTTP status, etc.)
}
Result is the outcome of a single publish attempt.
type SecretGetter ¶
SecretGetter retrieves a secret value by logical name.