incubator4 commented on code in PR #1471:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/1471#discussion_r1030723254


##########
pkg/types/apisix/v1/plugin_types.go:
##########
@@ -177,3 +191,46 @@ func (p *Headers) DeepCopy() *Headers {
        p.DeepCopyInto(out)
        return out
 }
+
+// +k8s:deepcopy-gen=true
+type Expr struct {
+       StringVal string
+       ArrayVal  []Expr
+}
+
+func (e *Expr) MarshalJSON() ([]byte, error) {
+       if e.StringVal != "" {
+               return json.Marshal(e.StringVal)
+       } else {
+               return json.Marshal(e.ArrayVal)
+       }
+}
+
+func (expr *Expr) UnmarshalJSON(buf []byte) error {

Review Comment:
   Hey, I was implementing a simple golang toolkit package called 
[go-resty-expr](https://github.com/incubator4/go-resty-expr) , 
   for generating expressions conforming to the 
[lua-resty-expr](https://github.com/api7/lua-resty-expr) specification.
   
   Also I've configured the corresponding tests and CI. May I use this package  
in this ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to