clair: github.com/coreos/clair/ext/notification Index | Files | Directories

package notification

import "github.com/coreos/clair/ext/notification"

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

Index

Package Files

driver.go

func RegisterSender Uses

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 Uses

func Senders() map[string]Sender

Senders returns the list of the registered Senders.

func UnregisterSender Uses

func UnregisterSender(name string)

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

type Config Uses

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 Uses

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(notificationName string) error
}

Sender represents anything that can transmit notifications.

Directories

PathSynopsis
webhookPackage webhook implements a notification sender for HTTP JSON webhooks.

Package notification imports 2 packages (graph) and is imported by 13 packages. Updated 2017-09-05. Refresh now. Tools for package owners.