Skip to content

Commit 513b891

Browse files
committed
feat: add suggestions category
1 parent e87500d commit 513b891

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

model/category/category.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const (
3131
Streams
3232
Rules
3333
Templates
34+
Suggestions
3435
)
3536

3637
// String is an implementation of Stringer interface that returns the string representation of category.Categories.
@@ -48,6 +49,7 @@ func (c Category) String() string {
4849
"streams",
4950
"rules",
5051
"templates",
52+
"suggestions",
5153
}[c]
5254
}
5355

@@ -83,6 +85,8 @@ func (c *Category) UnmarshalJSON(bytes []byte) error {
8385
*c = Rules
8486
case Templates.String():
8587
*c = Templates
88+
case Suggestions.String():
89+
*c = Suggestions
8690
default:
8791
return fmt.Errorf("invalid category encountered: %v", category)
8892
}
@@ -117,6 +121,8 @@ func (c Category) MarshalJSON() ([]byte, error) {
117121
category = Rules.String()
118122
case Templates:
119123
category = Templates.String()
124+
case Suggestions:
125+
category = Suggestions.String()
120126
default:
121127
return nil, fmt.Errorf("invalid category encountered: %v" + c.String())
122128
}

0 commit comments

Comments
 (0)