You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/11/23 17:34:26 UTC
[GitHub] [apisix-ingress-controller] incubator4 commented on a diff in pull request #1471: feat: add control http method using kubernetes ingress by annotations
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: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org