Documentation
¶
Overview ¶
Package slack posts one sweep summary per team to the team's channel.
The summary is the run history of the scheduled sweep: no report repository and no database, so a channel that fills with runs that changed nothing stops being read. Silence is therefore part of the contract, and Client.Post refuses an empty message rather than posting a heartbeat.
Index ¶
Constants ¶
const TokenEnv = "MARGE_SLACK_TOKEN"
TokenEnv carries the bot token of the sweep's own Slack app. The app holds chat:write and nothing else.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Token string
// APIURL overrides Slack's own root. Only the tests set it.
APIURL string
HTTP *http.Client
}
Client posts messages with chat.postMessage.
func LoadClient ¶
func LoadClient() *Client
LoadClient returns the client the environment configures, or nil when it carries no token, which is not an error: a sweep run by hand posts nothing. The caller reports the summary on its own output either way.