Documentation ¶
Index ¶
Constants ¶
View Source
const (
Name = "clutch.service.auditsink.slack"
)
Variables ¶
This section is empty.
Functions ¶
func FormatCustomText ¶
func FormatCustomText(message string, event *auditv1.RequestEvent) (string, error)
FormatCustomText applies the audit event metadata to the custom slack message
Types ¶
type OverrideLookup ¶
type OverrideLookup struct {
// contains filtered or unexported fields
}
OverrideLookup stores a map of the FullMethod to CustomMessage(s) that are provided in the slack config
func NewOverrideLookup ¶
func NewOverrideLookup(overrides []*configv1.CustomMessage) OverrideLookup
NewOverrideLookup creates a map from the overrides. The generated OverrideLookup is used to easily retrieve an override by key (/service/method).
func (OverrideLookup) GetOverrideMessage ¶
func (o OverrideLookup) GetOverrideMessage(service, method string) (string, bool)
GetOverrideMessage uses the OverrideLookup and the audit event's service + method name to check if an override exists for the key service/method. If found, the custom message is returned. Otherwise ok is false.
Click to show internal directories.
Click to hide internal directories.