Documentation
¶
Overview ¶
Package notify posts one sweep summary per team to the team's channel, through klaus-gateway's team-notice endpoint (POST /notices). The gateway owns the Slack app and the workspace credential; the sweep holds none.
The caller authenticates as itself: the projected ServiceAccount token the pod already carries, for the audience the gateway reviews. The file is read per call because the kubelet rotates it.
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 ( URLEnv = "MARGE_NOTICES_URL" TokenFileEnv = "MARGE_NOTICES_TOKEN_FILE" )
URLEnv carries the gateway's in-cluster base URL, TokenFileEnv the path of the projected ServiceAccount token.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// BaseURL is the gateway as reached from the pod, without a trailing
// path.
BaseURL string
// TokenFile holds the projected ServiceAccount token, read per post.
TokenFile string
HTTP *http.Client
}
Client posts notices.
func LoadClient ¶
func LoadClient() *Client
LoadClient returns the client the environment configures, or nil when it names no gateway, which is not an error: a sweep run by hand posts nothing. The caller reports the summary on its own output either way.