Documentation
¶
Index ¶
- func Delete(db database.QueryExecuter, ids []int) error
- func DeleteNotification(db database.QueryExecuter, appID, pipID, envID int64) error
- func Initialize(urls, key, base string)
- func Insert(db database.Querier, notif *sdk.Notif, notifType string) error
- func InsertOrUpdateUserNotificationSettings(db database.QueryExecuter, appID, pipID, envID int64, ...) error
- func LoadAllUserNotificationSettings(db database.Querier, appID int64) ([]sdk.UserNotification, error)
- func LoadUserNotificationSettings(db database.Querier, appID, pipID, envID int64) (*sdk.UserNotification, error)
- func ParseUserNotification(body []byte) (*sdk.UserNotification, error)
- func ParseUserNotificationSettings(settings []byte) (map[sdk.UserNotificationSettingsType]sdk.UserNotificationSettings, error)
- func SendActionBuild(db database.QueryExecuter, ab *sdk.ActionBuild, event sdk.NotifEventType, ...)
- func SendBuiltinNotif(db database.QueryExecuter, ab *sdk.ActionBuild, notif sdk.Notif)
- func SendMailNotif(notif *sdk.Notif)
- func SendPipeline(db database.QueryExecuter, pb *sdk.PipelineBuild, event sdk.NotifEventType, ...)
- func ShouldSendUserNotification(notif sdk.UserNotificationSettings, current *sdk.PipelineBuild, ...) bool
- func Status() []string
- func Update(db database.QueryExecuter, notif *sdk.Notif, status string) error
- type UserNotificationInput
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 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 ¶
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
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