notifications

package
v0.0.0-...-f116871 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PerformHttpRequest

func PerformHttpRequest(
	method string,
	url string,
	username string,
	password string,
	body io.Reader,
	headers map[string]string) (int, []byte, error)

PerformHttpRequest performs a HTTP request and returns the status code and the response

Types

type EmailNotifier

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

EmailNotifier implements a simple email sender

func (EmailNotifier) Send

func (notifier EmailNotifier) Send(hostname string, domainCount int, domainsStr, ipv4, ipv6 string) error

Send sends the email notification

type INotification

type INotification interface {
	Send(hostname string, domainCount int, domainsStr, ipv4, ipv6 string) error
}

INotification describes the interface of a type able to send a notification

type INotificationManager

type INotificationManager interface {
	GetNotifierCount() int
	Send(hostname string, domainCount int, domainsStr, ipv4, ipv6 string) error
}

INotificationManager describes the interface the notifications.Manager

func GetManager

func GetManager(conf *config.Notifications) INotificationManager

GetManager returns the notification manager

type Manager

type Manager struct {
	Notifiers []INotification
}

Manager wraps types that have the ability to send a notification

func (*Manager) GetNotifierCount

func (manager *Manager) GetNotifierCount() int

func (*Manager) Send

func (manager *Manager) Send(hostname string, domainCount int, domainsStr string, ipv4, ipv6 string) error

Send sends one or more notifications

type SipGateSmsNotifier

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

SipGateSmsNotifier implements the sipgate IO sms sender

sipgate docs:

https://api.sipgate.com/v2/doc#/sessions/sendWebSms
https://github.com/sipgate-io/sipgateio-sendsms-python

request url:

https://api.sipgate.com/v2/sessions/sms

json payload:

{
	"smsId": "smsId",
	"recipient": "0123456789",
	"message": "The IP address for domain 'example.com' has been updated to '127.0.0.1'"
}

func (SipGateSmsNotifier) Send

func (notifier SipGateSmsNotifier) Send(hostname string, domainCount int, domainsStr, ipv4, ipv6 string) error

Send sends the sipgate IO sms notification

Jump to

Keyboard shortcuts

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