notifications

package module
v0.0.0-...-ae6f546 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

README

NOTIFICATIONS

Universal notifications interface to push messages to chat services. Currently supports:

  • dummy (testing output)
  • hipchat
  • slack

EXAMPLE

        n, err := NotifierByName("dummy")
	if err != nil {
		panic(err)
	}
        n.Init()
        n.Notify("Test message from new client")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier interface {
	// Init performs housekeeping on startup
	Init()
	// Notify performs the actual notification
	Notify(string)
	// SetDebug allows internal debug information to be enabled or disabled. Defaults to false.
	SetDebug(bool)
	// SetCredentials allows one or more service-specific credential to be passed to a notifier. Most services will only use a single string.
	SetCredentials([]string)
	// SetTarget allows a message target to be specified.
	SetTarget(string)
}

Notifier defines an interface for all notification services.

var (
	NotifierService Notifier
)

func NotifierByName

func NotifierByName(name string) (*Notifier, error)

NotifierByName is a factory function which instantiates a notifier by its short name.

type NotifierHipChat

type NotifierHipChat struct {
	// contains filtered or unexported fields
}

func (NotifierHipChat) Init

func (n NotifierHipChat) Init()

func (NotifierHipChat) Notify

func (n NotifierHipChat) Notify(message string)

func (*NotifierHipChat) SetCredentials

func (n *NotifierHipChat) SetCredentials(creds []string)

func (*NotifierHipChat) SetDebug

func (n *NotifierHipChat) SetDebug(debug bool)

func (*NotifierHipChat) SetTarget

func (n *NotifierHipChat) SetTarget(target string)

type NotifierNone

type NotifierNone struct {
	// contains filtered or unexported fields
}

func (NotifierNone) Init

func (n NotifierNone) Init()

func (NotifierNone) Notify

func (n NotifierNone) Notify(message string)

func (*NotifierNone) SetCredentials

func (n *NotifierNone) SetCredentials(creds []string)

func (*NotifierNone) SetDebug

func (n *NotifierNone) SetDebug(debug bool)

func (*NotifierNone) SetTarget

func (n *NotifierNone) SetTarget(target string)

type NotifierSlack

type NotifierSlack struct {
	// contains filtered or unexported fields
}

func (NotifierSlack) Init

func (n NotifierSlack) Init()

func (NotifierSlack) Notify

func (n NotifierSlack) Notify(message string)

func (*NotifierSlack) SetCredentials

func (n *NotifierSlack) SetCredentials(creds []string)

func (*NotifierSlack) SetDebug

func (n *NotifierSlack) SetDebug(debug bool)

func (*NotifierSlack) SetTarget

func (n *NotifierSlack) SetTarget(target string)

Jump to

Keyboard shortcuts

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