Skip to content

Commit 4284233

Browse files
authored
Add: missing notification Level urgent (#295)
## What - Add missing notification urgent Level - Add AllowedLevels slice ## Why To cover all possible notification Levels ## References - greenbone/opensight-notification-service#200 - https://jira.greenbone.net/browse/VTI-784 ## Checklist
2 parents a753feb + c8e1785 commit 4284233

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pkg/httpassert/request.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ func (s *starter) Getf(format string, a ...interface{}) Request {
132132
func (s *starter) Options(path string) Request {
133133
return s.newRequest(http.MethodOptions, path)
134134
}
135+
135136
func (s *starter) Optionsf(format string, a ...interface{}) Request {
136137
return s.newRequest(http.MethodOptions, fmt.Sprintf(format, a...))
137138
}

pkg/notifications/model.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,16 @@ const (
3939
LevelInfo Level = "info"
4040
LevelWarning Level = "warning"
4141
LevelError Level = "error"
42+
LevelUrgent Level = "urgent"
4243
)
4344

45+
var AllowedLevels = []Level{
46+
LevelInfo,
47+
LevelWarning,
48+
LevelError,
49+
LevelUrgent,
50+
}
51+
4452
// toNotificationModel converts a Notification to the rest model for the notification service.
4553
// It also adds the current time as timestamp if it is not set.
4654
func toNotificationModel(n Notification) notificationModel {

0 commit comments

Comments
 (0)