messengers

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2015 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

walter: a deployment pipeline template
* Copyright (C) 2014 Recruit Technologies Co., Ltd. and contributors
* (see CONTRIBUTORS.md)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.

walter: a deployment pipeline template
* Copyright (C) 2014 Recruit Technologies Co., Ltd. and contributors
* (see CONTRIBUTORS.md)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.

walter: a deployment pipeline template
* Copyright (C) 2014 Recruit Technologies Co., Ltd. and contributors
* (see CONTRIBUTORS.md)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.

walter: a deployment pipeline template
* Copyright (C) 2014 Recruit Technologies Co., Ltd. and contributors
* (see CONTRIBUTORS.md)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.

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"`
}

func (*BaseMessenger) Post added in v1.2.0

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

func (*BaseMessenger) Suppress added in v1.2.0

func (self *BaseMessenger) Suppress(output_type string) bool

type FakeMessenger

type FakeMessenger struct {
	BaseMessenger
}

FakeMessenger is a Messenger type used only for testing.

func (*FakeMessenger) Post

func (self *FakeMessenger) Post(messege string) bool

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 (self *HipChat) Post(message string) bool

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) bool

Post sends a new HipChat message using V2 of the API

type Messenger

type Messenger interface {
	Post(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 (self *Slack) Post(message string) bool

Jump to

Keyboard shortcuts

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