Documentation
¶
Index ¶
- func ChatText(e types.InteractionEvent) string
- func CurlCommand(e types.InteractionEvent) string
- func FilterMatches(filter *regexp.Regexp, data string) bool
- func NewNotifierFromConfig(cfg map[string]string) types.Notifier
- func SendPost(url string, payload []byte) error
- func ShouldSend(filter *regexp.Regexp, e types.InteractionEvent) bool
- func TruncateChat(s string, max int) string
- type Notifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChatText ¶ added in v0.0.24
func ChatText(e types.InteractionEvent) string
ChatText renders the standard chat-notifier body: the event details, its raw data in a code block, and — when available — a curl command to replay the request in a second code block. Sink-hit events get an enriched header. Binary data is replaced with a placeholder to avoid garbled chat messages.
func CurlCommand ¶ added in v0.0.24
func CurlCommand(e types.InteractionEvent) string
CurlCommand returns a replay curl command for events that can produce one (HTTP), or "" otherwise.
func NewNotifierFromConfig ¶ added in v0.1.3
NewNotifierFromConfig creates a standalone webhook notifier from a YAML config map. Recognized keys: "url" (required), "filter" (optional, defaults to ".*").
func ShouldSend ¶ added in v0.1.6
func ShouldSend(filter *regexp.Regexp, e types.InteractionEvent) bool
ShouldSend reports whether a notifier should deliver the event. It returns true when the event bypasses filters (e.g. sink-hit events) or when the filter regex matches the event's FilterString.
func TruncateChat ¶ added in v0.1.6
TruncateChat truncates a chat message to max characters, closing any open markdown code block so the rendering isn't broken.
Types ¶
type Notifier ¶
type Notifier struct {
URL string
// contains filtered or unexported fields
}