File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments