notification

package
v2.0.0-pre.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package notification exposes functions to dynamically register methods to deliver notifications from the Clair database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSender

func RegisterSender(name string, s Sender)

RegisterSender makes a Sender available by the provided name.

If called twice with the same name, the name is blank, or if the provided Sender is nil, this function panics.

func Senders

func Senders() map[string]Sender

Senders returns the list of the registered Senders.

func UnregisterSender

func UnregisterSender(name string)

UnregisterSender removes a Sender with a particular name from the list.

Types

type Config

type Config struct {
	Attempts         int
	RenotifyInterval time.Duration
	Params           map[string]interface{} `yaml:",inline"`
}

Config is the configuration for the Notifier service and its registered notifiers.

type Sender

type Sender interface {
	// Configure attempts to initialize the notifier with the provided configuration.
	// It returns whether the notifier is enabled or not.
	Configure(*Config) (bool, error)

	// Send informs the existence of the specified notification.
	Send(notification database.VulnerabilityNotification) error
}

Sender represents anything that can transmit notifications.

Directories

Path Synopsis
Package webhook implements a notification sender for HTTP JSON webhooks.
Package webhook implements a notification sender for HTTP JSON webhooks.

Jump to

Keyboard shortcuts

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