notifier

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Telegram

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

Telegram struct to be able to notify with Telegram messages

func NewTelegram

func NewTelegram(
	token string,
	chatID int64,
	template string,
) *Telegram

NewTelegram returns a new Telegram notifier

func (*Telegram) Notify

func (t *Telegram) Notify(
	domain string,
	recordName string,
	recordType string,
	previousIP string,
	newIP string,
) error

Notify launches a new message on Telegram when the IP has changed

type TelegramMessageData

type TelegramMessageData struct {
	Domain     string
	RecordName string
	RecordType string
	PreviousIP string
	NewIP      string
}

TelegramMessageData holds information for the Telegram template message

Jump to

Keyboard shortcuts

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