base

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package base is the base implementation of the notification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultNotify

type DefaultNotify struct {
	NotifyKind     string                     `yaml:"-" json:"-"`
	NotifyFormat   report.Format              `yaml:"-" json:"-"`
	NotifySendFunc func(string, string) error `yaml:"-" json:"-"`
	NotifyName     string                     `yaml:"name" json:"name" jsonschema:"required,title=Notification Name,description=The name of the notification"`
	NotifyChannels []string                   `` /* 137-byte string literal not displayed */
	Dry            bool                       `` /* 131-byte string literal not displayed */
	Timeout        time.Duration              `` /* 136-byte string literal not displayed */
	Retry          global.Retry               `yaml:"retry,omitempty" json:"retry,omitempty" jsonschema:"title=Retry,description=The retry of the notification"`
}

DefaultNotify is the base struct of the Notify

func (*DefaultNotify) Channels added in v1.6.0

func (c *DefaultNotify) Channels() []string

Channels returns the channels of the notification

func (*DefaultNotify) Config

func (c *DefaultNotify) Config(gConf global.NotifySettings) error

Config is the default configuration for notification

func (*DefaultNotify) DryNotify

func (c *DefaultNotify) DryNotify(result probe.Result)

DryNotify just log the notification message

func (*DefaultNotify) DryNotifyStat

func (c *DefaultNotify) DryNotifyStat(probers []probe.Prober)

DryNotifyStat just log the notification message

func (*DefaultNotify) Kind added in v1.6.0

func (c *DefaultNotify) Kind() string

Kind returns the kind of the notification

func (*DefaultNotify) Name

func (c *DefaultNotify) Name() string

Name returns the name of the notification

func (*DefaultNotify) Notify

func (c *DefaultNotify) Notify(result probe.Result)

Notify send the result message to the email

func (*DefaultNotify) NotifyStat

func (c *DefaultNotify) NotifyStat(probers []probe.Prober)

NotifyStat send the stat message into the email

func (*DefaultNotify) SendWithRetry

func (c *DefaultNotify) SendWithRetry(title string, message string, tag string)

SendWithRetry sends the notification with retry if got error

Jump to

Keyboard shortcuts

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