notifiers

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 10 Imported by: 0

README

Notifications

Slack

First create a Slack App with chat:write and chat:write.public (optional) scopes

Then specify 1 or more slack apps (with name and auth-token bot user OAuth token) and channels (name and channel-id for each)

Configuration:

  • auth-token
    • type: string
    • required: yes
  • channel-id
    • type: string
    • required: yes

Sample configuration:

notifications:
  
    ... [reducted]

    slack:
        apps:                   # list of slack apps
            - name: "go-alive-test-bot"
              token: "add bot user oauth token here"
        channels:               # list of slack channels
            - name: "go-alive-test-group"
              channelid: 'CHANNEL ID'

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailNotifier

type EmailNotifier struct {
	// contains filtered or unexported fields
}

EmailNotifier - Email Notifier

func NewEmailNotifier

func NewEmailNotifier(smtpConfig c.SmtpConfiguration, recipientConfig c.EmailRecipientConfiguration) *EmailNotifier

NewEmailNotifier - Email Notifier constructor

func (*EmailNotifier) NotifyHealthCheckResult

func (t *EmailNotifier) NotifyHealthCheckResult(result s.HealthCheckResult, templateString string) error

NotifyHealthCheckResult - Sends email of target scan result

func (*EmailNotifier) NotifySpecificPortHealthCheckResult

func (t *EmailNotifier) NotifySpecificPortHealthCheckResult(result s.SpecificPortHealthCheckResult, templateString string) error

NotifySpecificPortHealthCheckResult - Sends email for each specific port scan

type Notifier

type Notifier interface {
	NotifySpecificPortHealthCheckResult(result s.SpecificPortHealthCheckResult, templateString string) error
	NotifyHealthCheckResult(result s.HealthCheckResult, templateString string) error
}

Notifier - Interface for each notification medium

type SlackNotifier

type SlackNotifier struct {
	// contains filtered or unexported fields
}

SlackNotifier - Slack Notifier constructor

func NewSlackNotifier

func NewSlackNotifier(botConfig c.SlackAppConfiguration, chatConfig c.SlackChannelConfiguration) *SlackNotifier

NewSlackNotifier - Slack Notifier constructor

func (*SlackNotifier) NotifyHealthCheckResult

func (t *SlackNotifier) NotifyHealthCheckResult(result s.HealthCheckResult, templateString string) error

NotifyHealthCheckResult - Sends slack message of target scan result

func (*SlackNotifier) NotifySpecificPortHealthCheckResult

func (t *SlackNotifier) NotifySpecificPortHealthCheckResult(result s.SpecificPortHealthCheckResult, templateString string) error

NotifySpecificPortHealthCheckResult - Sends slack message for each specific port scan

type TelegramNotifier

type TelegramNotifier struct {
	// contains filtered or unexported fields
}

TelegramNotifier - Telegram Notifier

func NewTelegramNotifier

func NewTelegramNotifier(botConfig c.TelegramBotConfiguration, chatConfig c.TelegramChatConfiguration) *TelegramNotifier

NewTelegramNotifier - Telegram Notifier constructor

func (*TelegramNotifier) NotifyHealthCheckResult

func (t *TelegramNotifier) NotifyHealthCheckResult(result s.HealthCheckResult, templateString string) error

NotifyHealthCheckResult - Sends telegrams message of target scan result

func (*TelegramNotifier) NotifySpecificPortHealthCheckResult

func (t *TelegramNotifier) NotifySpecificPortHealthCheckResult(result s.SpecificPortHealthCheckResult, templateString string) error

NotifySpecificPortHealthCheckResult - Sends telegram message for each specific port scan

Jump to

Keyboard shortcuts

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