Documentation ¶
Index ¶
- func DeleteNotification(db database.QueryExecuter, appID, pipID, envID int64) error
- func GetUserEvents(db database.QueryExecuter, pb *sdk.PipelineBuild, previous *sdk.PipelineBuild) []sdk.EventNotif
- 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 SendMailNotif(notif sdk.EventNotif)
- func ShouldSendUserNotification(notif sdk.UserNotificationSettings, current *sdk.PipelineBuild, ...) bool
- type UserNotificationInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteNotification ¶
func DeleteNotification(db database.QueryExecuter, appID, pipID, envID int64) error
DeleteNotification Delete a notifications for the given application/pipeline/environment
func GetUserEvents ¶ added in v0.4.0
func GetUserEvents(db database.QueryExecuter, pb *sdk.PipelineBuild, previous *sdk.PipelineBuild) []sdk.EventNotif
GetUserEvents returns event from user notification
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 SendMailNotif ¶
func SendMailNotif(notif sdk.EventNotif)
SendMailNotif Send user notification by mail
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