notifications

package
v0.0.0-...-e45cdf7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscordWebhook

type DiscordWebhook struct {
	URL           string
	Client        *webhook.Client
	Connected     bool
	AllowedNotifs []string
}

func (*DiscordWebhook) Connect

func (d *DiscordWebhook) Connect() (bool, string)

func (*DiscordWebhook) FromConfig

func (d *DiscordWebhook) FromConfig(config viper.Viper)

func (DiscordWebhook) Notify

func (d DiscordWebhook) Notify(title string, description string, notifType string, path string) bool

type GotifyNotifs

type GotifyNotifs struct {
	URL           string
	Client        *client.GotifyREST
	AuthToken     string
	Connected     bool
	AllowedNotifs []string
	Log           log.Logger
}

func (*GotifyNotifs) Connect

func (d *GotifyNotifs) Connect() bool

func (*GotifyNotifs) FromConfig

func (d *GotifyNotifs) FromConfig(config viper.Viper)

func (GotifyNotifs) Notify

func (d GotifyNotifs) Notify(title string, description string, notifType string, path string) bool

type Healthchecks

type Healthchecks struct {
	AllowedNotifs []string
	URL           string
	// contains filtered or unexported fields
}

func (Healthchecks) Connect

func (h Healthchecks) Connect() bool

func (*Healthchecks) FromConfig

func (h *Healthchecks) FromConfig(config viper.Viper)

func (Healthchecks) Notify

func (h Healthchecks) Notify(title string, description string, notifType string, path string) bool

type Notification

type Notification interface {
	Notify(string, string, string, string) bool
}

type Notifications

type Notifications struct {
	EnabledServices []Notification

	Log log.Logger
	// contains filtered or unexported fields
}

func (*Notifications) Connect

func (n *Notifications) Connect()

func (*Notifications) FromConfig

func (n *Notifications) FromConfig(c viper.Viper)

func (Notifications) Notify

func (n Notifications) Notify(title string, description string, notifType string, path string)

type Notifywebhook

type Notifywebhook struct {
	AllowedNotifs []string
	Log           log.Logger
	// contains filtered or unexported fields
}

func (*Notifywebhook) Connect

func (n *Notifywebhook) Connect() bool

func (*Notifywebhook) FromConfig

func (n *Notifywebhook) FromConfig(config viper.Viper)

func (Notifywebhook) Notify

func (n Notifywebhook) Notify(title string, description string, notifType string, path string) bool

type Pushbullet

type Pushbullet struct {
	AllowedNotifs []string

	Log log.Logger
	// contains filtered or unexported fields
}

func (*Pushbullet) Connect

func (p *Pushbullet) Connect() bool

func (*Pushbullet) FromConfig

func (p *Pushbullet) FromConfig(config viper.Viper)

func (Pushbullet) Notify

func (p Pushbullet) Notify(title string, description string, notifType string, path string) bool

type Pushover

type Pushover struct {
	AllowedNotifs []string

	Log log.Logger
	// contains filtered or unexported fields
}

func (*Pushover) Connect

func (p *Pushover) Connect() bool

func (*Pushover) FromConfig

func (p *Pushover) FromConfig(config viper.Viper)

func (Pushover) Notify

func (p Pushover) Notify(title string, description string, notifType string, path string) bool

type SplunkEvent

type SplunkEvent struct {
	Event      *SplunkEventData `json:"event"`
	Time       int64            `json:"time"`
	SourceType string           `json:"sourcetype"`
}

type SplunkEventData

type SplunkEventData struct {
	Type string `json:"type"`
	Path string `json:"path,omitempty"`
}

type SplunkHEC

type SplunkHEC struct {
	URL           string
	Token         string
	Connected     bool
	AllowedNotifs []string
	Log           log.Logger
}

func (*SplunkHEC) Connect

func (d *SplunkHEC) Connect() bool

func (*SplunkHEC) FromConfig

func (d *SplunkHEC) FromConfig(config viper.Viper)

func (SplunkHEC) Notify

func (d SplunkHEC) Notify(title string, description string, notifType string, path string) bool

type Telegram

type Telegram struct {
	AllowedNotifs []string

	Log log.Logger
	// contains filtered or unexported fields
}

func (*Telegram) Connect

func (t *Telegram) Connect() bool

func (*Telegram) FromConfig

func (t *Telegram) FromConfig(config viper.Viper)

func (Telegram) Notify

func (t Telegram) Notify(title string, description string, notifType string, path string) bool

Jump to

Keyboard shortcuts

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