notification

package
v0.0.0-...-a57a29f Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2016 License: BSD-3-Clause Imports: 14 Imported by: 0

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