channel

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 channel implements the channel interface

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllDone

func AllDone()

AllDone send the done signal to all channels

func ConfigAllChannels

func ConfigAllChannels()

ConfigAllChannels config all channels

func GetAllChannels

func GetAllChannels() map[string]*Channel

GetAllChannels returns all channels

func GetNotifiers

func GetNotifiers(channel []string) map[string]notify.Notify

GetNotifiers returns all of the notifiers by a list of channel names

func IsDryNotify added in v1.8.0

func IsDryNotify() bool

IsDryNotify returns the dry run flag

func SetChannel

func SetChannel(name string)

SetChannel sets the channel

func SetDryNotify

func SetDryNotify(dry bool)

SetDryNotify sets the global dry run flag

func SetNotifiers

func SetNotifiers(notifiers []notify.Notify)

SetNotifiers set a notify to the channel

func SetNotify

func SetNotify(channel string, n notify.Notify)

SetNotify set a notify to the channel

func SetProber

func SetProber(channel string, p probe.Prober)

SetProber sets the prober

func SetProbers

func SetProbers(probers []probe.Prober)

SetProbers sets the probers

func WatchForAllEvents

func WatchForAllEvents()

WatchForAllEvents watch the event for all channels

Types

type Channel

type Channel struct {
	Name      string                   `yaml:"name"`      // unique name
	Probers   map[string]probe.Prober  `yaml:"probers"`   // probers
	Notifiers map[string]notify.Notify `yaml:"notifiers"` // notifiers
	// contains filtered or unexported fields
}

Channel implements a config for Channel

func GetChannel

func GetChannel(name string) *Channel

GetChannel returns the channel

func NewEmpty

func NewEmpty(name string) *Channel

NewEmpty creates a new empty Channel object with nil channel After setup the probers, You have to call Config() to create the channel

func (*Channel) Channel

func (c *Channel) Channel() chan probe.Result

Channel returns the notification channel

func (*Channel) Config

func (c *Channel) Config()

Config configures the channel

func (*Channel) Done

func (c *Channel) Done() chan bool

Done returns the done channel

func (*Channel) GetNotify

func (c *Channel) GetNotify(name string) notify.Notify

GetNotify returns the Notify object

func (*Channel) GetProber

func (c *Channel) GetProber(name string) probe.Prober

GetProber returns the Notify object

func (*Channel) Send

func (c *Channel) Send(result probe.Result)

Send sends the result to the channel

func (*Channel) SetNotifiers

func (c *Channel) SetNotifiers(notifiers []notify.Notify)

SetNotifiers sets the Notify objects

func (*Channel) SetNotify

func (c *Channel) SetNotify(n notify.Notify)

SetNotify sets the Notify object

func (*Channel) SetProber

func (c *Channel) SetProber(p probe.Prober)

SetProber sets the Notify object

func (*Channel) SetProbers

func (c *Channel) SetProbers(probers []probe.Prober)

SetProbers sets the Notify objects

func (*Channel) WatchEvent

func (c *Channel) WatchEvent(wg *sync.WaitGroup)

WatchEvent watches the notification event Go through all of notification to notify the result.

Jump to

Keyboard shortcuts

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