notification

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2017 License: BSD-3-Clause Imports: 14 Imported by: 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(db database.QueryExecuter, ids []int) error

Delete remove a notification from database

func DeleteNotification

func DeleteNotification(db database.QueryExecuter, appID, pipID, envID int64) error

DeleteNotification Delete a notifications for the given application/pipeline/environment

func Initialize

func Initialize(urls, key, base string)

Initialize initializes Notifications System

func Insert

func Insert(db database.Querier, notif *sdk.Notif, notifType string) error

Insert save a notification in database

func InsertOrUpdateUserNotificationSettings

func InsertOrUpdateUserNotificationSettings(db database.QueryExecuter, appID, pipID, envID int64, notif *sdk.UserNotification) error

InsertOrUpdateUserNotificationSettings insert or update value in application_pipeline_notif

func LoadAllUserNotificationSettings

func LoadAllUserNotificationSettings(db database.Querier, appID int64) ([]sdk.UserNotification, error)

LoadAllUserNotificationSettings load data from application_pipeline_notif

func LoadUserNotificationSettings

func LoadUserNotificationSettings(db database.Querier, appID, pipID, envID int64) (*sdk.UserNotification, error)

LoadUserNotificationSettings load data from application_pipeline_notif

func ParseUserNotification

func ParseUserNotification(body []byte) (*sdk.UserNotification, error)

ParseUserNotification transform jsons to UserNotificationSettings map

func ParseUserNotificationSettings

func ParseUserNotificationSettings(settings []byte) (map[sdk.UserNotificationSettingsType]sdk.UserNotificationSettings, error)

ParseUserNotificationSettings transforms json to UserNotificationSettings map

func SendActionBuild

func SendActionBuild(db database.QueryExecuter, ab *sdk.ActionBuild, event sdk.NotifEventType, status sdk.Status)

SendActionBuild sends a build notification

func SendBuiltinNotif

func SendBuiltinNotif(db database.QueryExecuter, ab *sdk.ActionBuild, notif sdk.Notif)

SendBuiltinNotif sends a builtin notification

func SendMailNotif

func SendMailNotif(notif *sdk.Notif)

SendMailNotif Send user notification by mail

func SendPipeline

func SendPipeline(db database.QueryExecuter, pb *sdk.PipelineBuild, event sdk.NotifEventType, status sdk.Status, previous *sdk.PipelineBuild)

SendPipeline sends a pipeline notification at end of build

func ShouldSendUserNotification

func ShouldSendUserNotification(notif sdk.UserNotificationSettings, current *sdk.PipelineBuild, previous *sdk.PipelineBuild) bool

ShouldSendUserNotification check if user notification has to be sent

func Status

func Status() []string

Status is used by Status Handler

func Update

func Update(db database.QueryExecuter, notif *sdk.Notif, status string) error

Update updates a notification in database

Types

type UserNotificationInput

type UserNotificationInput struct {
	Notifications         map[string]interface{} `json:"notifications"`
	ApplicationPipelineID int64                  `json:"application_pipeline_id"`
	Environment           sdk.Environment        `json:"environment"`
	Pipeline              sdk.Pipeline           `json:"pipeline"`
}

UserNotificationInput is a way to parse notification

Jump to

Keyboard shortcuts

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