notification

package
v0.0.0-...-69ea562 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// Global settings
	Host string

	// User that owns the repository
	User *model.User

	// Repository being built.
	Repo *model.Repo

	// Commit being built
	Commit *model.Commit
}

Context represents the context of an in-progress build request.

type Email

type Email struct {
	Recipients []string `yaml:"recipients,omitempty"`
	Success    string   `yaml:"on_success"`
	Failure    string   `yaml:"on_failure"`
	// contains filtered or unexported fields
}

func (*Email) Send

func (e *Email) Send(context *Context) error

Send will send an email, either success or failure, based on the Commit Status.

func (*Email) SetServer

func (e *Email) SetServer(host, port, user, pass, from string)

SetServer is a function that will set the SMTP server location and credentials

type Hipchat

type Hipchat struct {
	Room    string `yaml:"room,omitempty"`
	Token   string `yaml:"token,omitempty"`
	Started bool   `yaml:"on_started,omitempty"`
	Success bool   `yaml:"on_success,omitempty"`
	Failure bool   `yaml:"on_failure,omitempty"`
}

func (*Hipchat) Send

func (h *Hipchat) Send(context *Context) error

type Notification

type Notification struct {
	Email   *Email   `yaml:"email,omitempty"`
	Webhook *Webhook `yaml:"webhook,omitempty"`
	Hipchat *Hipchat `yaml:"hipchat,omitempty"`
}

Notification stores the configuration details for notifying a user, or group of users, when their Build has completed.

func (*Notification) Send

func (n *Notification) Send(context *Context) error

type Sender

type Sender interface {
	Send(context *Context) error
}

type Webhook

type Webhook struct {
	URL     []string `yaml:"urls,omitempty"`
	Success bool     `yaml:"on_success,omitempty"`
	Failure bool     `yaml:"on_failure,omitempty"`
}

func (*Webhook) Send

func (w *Webhook) Send(context *Context) error

Jump to

Keyboard shortcuts

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