notifications

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ColorHex = "#406170"

ColorHex is the default notification color used for services that support it (formatted as a CSS hex string)

View Source
const ColorInt = 0x406170

ColorInt is the default notification color used for services that support it (as an int value)

Variables

View Source
var LocalLog = log.WithField("notify", "no")

LocalLog is a logrus logger that does not send entries as notifications

Functions

func AppendLegacyUrls added in v1.4.0

func AppendLegacyUrls(urls []string, cmd *cobra.Command, title string) ([]string, time.Duration)

AppendLegacyUrls creates shoutrrr equivalent URLs from legacy notification flags

func GetHostname added in v1.4.0

func GetHostname(c *cobra.Command) string

GetHostname returns the hostname as set by args or resolved from OS

func GetScheme added in v1.4.0

func GetScheme(url string) string

GetScheme returns the scheme part of a Shoutrrr URL

func GetTitle added in v1.2.0

func GetTitle(hostname string) string

GetTitle returns a common notification title with hostname appended

func NewNotifier

func NewNotifier(c *cobra.Command) ty.Notifier

NewNotifier creates and returns a new Notifier, using global configuration.

Types

type Data added in v1.4.0

type Data struct {
	Entries []*log.Entry
	Report  t.Report
	Title   string
	Host    string
}

Data is the notification template data model

Jump to

Keyboard shortcuts

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