slack

package
v0.1.2-rc0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name        string = "slack"
	Description string = "Send a message to Slack"
	Permissions string = ""
	Example     string = `` /* 273-byte string literal not displayed */

)
View Source
const (
	Red   string = "#e20b0b"
	Green string = "#23ba47"
	Grey  string = "#a4a8b1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Fallback   string  `json:"fallback"`
	Color      string  `json:"color"`
	Text       string  `json:"text,omitempty"`
	Footer     string  `json:"footer,omitempty"`
	FooterIcon string  `json:"footer_icon,omitempty"`
	Fields     []Field `json:"fields"`
}

type Field

type Field struct {
	Title string `json:"title"`
	Value string `json:"value"`
	Short bool   `json:"short"`
}

type Notifier

type Notifier struct{}

func Register

func Register() *Notifier

func (Notifier) Information

func (n Notifier) Information() models.Information

func (Notifier) Init

func (n Notifier) Init(fields map[string]any) error

func (Notifier) Parameters

func (n Notifier) Parameters() models.Parameters

func (Notifier) Run

func (n Notifier) Run(log utils.LogLine) error

type Parameters

type Parameters struct {
	WebhookURL string `field:"webhook_url" validate:"required"`
	Icon       string `field:"icon" default:"https://upload.wikimedia.org/wikipedia/commons/2/26/Circaetus_gallicus_claw.jpg"`
	Username   string `field:"username" default:"Falco Talon"`
	Footer     string `field:"footer" default:"http://github.com/falcosecurity/falco-talon"`
	Format     string `field:"format" default:"long"`
}

type Payload

type Payload struct {
	Text        string       `json:"text,omitempty"`
	Username    string       `json:"username,omitempty"`
	IconURL     string       `json:"icon_url,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

Payload

Jump to

Keyboard shortcuts

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