messengers

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package messengers defines clients for the messaging services such as Slack. The clients reports the results of the pipeline stages and whole results.

Package messengers provides all functionality for the suported messengers

Package messengers provides all functionality for the suported messengers

Package messengers provides all functionality for the suported messengers

Package messengers provides all functionality for the suported messengers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMessenger added in v1.2.0

type BaseMessenger struct {
	SuppressFields []string `config:"suppress"`
}

BaseMessenger struct

func (*BaseMessenger) Post added in v1.2.0

func (baseMessenger *BaseMessenger) Post(messege string) bool

Post posts the supplied message

func (*BaseMessenger) Suppress added in v1.2.0

func (baseMessenger *BaseMessenger) Suppress(outputType string) bool

Suppress idenitifies if the supplied output type is a suppressed field

type FakeMessenger

type FakeMessenger struct {
	BaseMessenger
}

FakeMessenger is a Messenger type used only for testing.

func (*FakeMessenger) Post

func (fakeMsg *FakeMessenger) Post(messege string, color ...string) bool

Post just returns true indicating the messages was posted (faked)

type HipChat

type HipChat struct {
	BaseMessenger `config:"suppress"`
	RoomID        string `config:"room_id"`
	Token         string `config:"token"`
	From          string `config:"from"`
}

HipChat is a client which reports the pipeline results to the HipChat server. The client uses V1 of the HipChat API.

func (*HipChat) Post

func (hipChat *HipChat) Post(message string, color ...string) bool

Post posts a hipchat message TODO: make hipchat api endpoint configurable for on-premises servers

type HipChat2 added in v0.2.0

type HipChat2 struct {
	BaseMessenger `config:"suppress"`
	RoomID        string `config:"room_id"`
	Token         string `config:"token"`
	From          string `config:"from"`
	BaseURL       string `config:"base_url"`
	// contains filtered or unexported fields
}

HipChat2 is a client which reports the pipeline results to the HipChat server. The client uses V2 of the HipChat API.

func (*HipChat2) Post added in v0.2.0

func (hc *HipChat2) Post(message string, color ...string) bool

Post sends a new HipChat message using V2 of the API

type Messenger

type Messenger interface {
	Post(string, ...string) bool
	Suppress(string) bool
}

Messenger is a interface for notifying the result to the messeging services such as Slack or HipChat.

func InitMessenger

func InitMessenger(mtype string) (Messenger, error)

InitMessenger generates a spefified Messenger client objet.

type Slack added in v0.2.0

type Slack struct {
	BaseMessenger `config:"suppress"`
	Channel       string `config:"channel" json:"channel"`
	UserName      string `config:"username" json:"username"`
	IconEmoji     string `config:"icon" json:"icon_emoji,omitempty"`
	IconURL       string `config:"icon_url" json:"icon_url,omitempty"`
	IncomingURL   string `config:"url" json:"-"` // not map to json
}

Slack is a client which reports the pipeline results to the Slack chennel.

func (*Slack) Post added in v0.2.0

func (slack *Slack) Post(message string, c ...string) bool

Post posts a message to slack

Jump to

Keyboard shortcuts

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