From 225dfc3eed6e20bbfc3637b78aead3232d0c2e98 Mon Sep 17 00:00:00 2001 From: Rokibul Hasan Date: Thu, 2 Jan 2025 10:25:14 +0600 Subject: [PATCH] Add `Neutal` field in AlertType Signed-off-by: Rokibul Hasan --- types.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types.go b/types.go index fb1894b..5f6d49f 100644 --- a/types.go +++ b/types.go @@ -374,6 +374,7 @@ const ( Success AlertType = iota Info Error + Neutral ) func (at AlertType) MarshalJSON() ([]byte, error) { @@ -384,6 +385,8 @@ func (at AlertType) MarshalJSON() ([]byte, error) { return json.Marshal("info") case Error: return json.Marshal("error") + case Neutral: + return json.Marshal("neutral") default: return nil, fmt.Errorf("invalid AlertType value") } @@ -402,6 +405,8 @@ func (at *AlertType) UnmarshalJSON(data []byte) error { *at = Info case "error": *at = Error + case "neutral": + *at = Neutral default: return errors.New("invalid AlertType value: " + typeValue) }