slack

package
v0.0.0-...-13416ad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

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

func New

func New(cfg *any.Any, logger *zap.Logger, scope tally.Scope) (service.Service, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL