Alanxtl commented on code in PR #841:
URL: https://github.com/apache/dubbo-go-pixiu/pull/841#discussion_r2629455238
##########
pkg/config/xds/cds_test.go:
##########
@@ -39,20 +36,21 @@ import (
import (
"github.com/apache/dubbo-go-pixiu/pkg/config/xds/apiclient"
+ model2 "github.com/apache/dubbo-go-pixiu/pkg/config/xds/model"
Review Comment:
ditto
##########
pkg/config/xds/apiclient/grpc_envoy.go:
##########
@@ -44,10 +41,20 @@ import (
)
import (
+ model2 "github.com/apache/dubbo-go-pixiu/pkg/config/xds/model"
Review Comment:
model2 -> xdsmodel
##########
admin/controller/configInfo/cluster.go:
##########
@@ -22,15 +22,14 @@ import (
)
import (
- fc "github.com/dubbo-go-pixiu/pixiu-api/pkg/api/config"
-
"github.com/gin-gonic/gin"
)
import (
"github.com/apache/dubbo-go-pixiu/admin/config"
"github.com/apache/dubbo-go-pixiu/admin/logic"
"github.com/apache/dubbo-go-pixiu/pkg/common/yaml"
+ fc "github.com/apache/dubbo-go-pixiu/pkg/config"
Review Comment:
rename this kind of import
"github.com/apache/dubbo-go-pixiu/admin/config" -> "adminConfig
github.com/apache/dubbo-go-pixiu/admin/config"
"fc github.com/apache/dubbo-go-pixiu/pkg/config" ->
"github.com/apache/dubbo-go-pixiu/pkg/config"
##########
pkg/config/xds/lds.go:
##########
@@ -23,13 +23,12 @@ import (
)
import (
- xdsModel "github.com/dubbo-go-pixiu/pixiu-api/pkg/xds/model"
-
"gopkg.in/yaml.v3"
)
import (
"github.com/apache/dubbo-go-pixiu/pkg/config/xds/apiclient"
+ model2 "github.com/apache/dubbo-go-pixiu/pkg/config/xds/model"
Review Comment:
ditto
##########
pkg/config/api_config.go:
##########
@@ -466,3 +464,237 @@ func getCheckRatelimitRegexp() *regexp.Regexp {
func RegisterConfigListener(li APIConfigResourceListener) {
listener = li
}
+
+// HTTPVerb defines the restful api http verb
+type HTTPVerb string
+
+const (
+ // MethodAny any method
+ MethodAny HTTPVerb = "ANY"
+ // MethodGet get
+ MethodGet HTTPVerb = "GET"
+ // MethodHead head
+ MethodHead HTTPVerb = "HEAD"
+ // MethodPost post
+ MethodPost HTTPVerb = "POST"
+ // MethodPut put
+ MethodPut HTTPVerb = "PUT"
+ // MethodPatch patch
+ MethodPatch HTTPVerb = "PATCH" // RFC 5789
+ // MethodDelete delete
+ MethodDelete HTTPVerb = "DELETE"
+ // MethodOptions options
+ MethodOptions HTTPVerb = "OPTIONS"
+)
Review Comment:
These kind of const has already been defined in
`pkg/common/constant/http.go`, reuse the already defined const
##########
pkg/config/xds/cds.go:
##########
@@ -18,14 +18,12 @@
package xds
import (
- "github.com/dubbo-go-pixiu/pixiu-api/pkg/api"
- xdspb "github.com/dubbo-go-pixiu/pixiu-api/pkg/xds/model"
-
"github.com/pkg/errors"
)
import (
"github.com/apache/dubbo-go-pixiu/pkg/config/xds/apiclient"
+ model2 "github.com/apache/dubbo-go-pixiu/pkg/config/xds/model"
Review Comment:
ditto
##########
pkg/filter/http/remote/resolver/resolver.go:
##########
@@ -24,15 +24,12 @@ import (
"strings"
)
-import (
- apiConf "github.com/dubbo-go-pixiu/pixiu-api/pkg/api/config"
- "github.com/dubbo-go-pixiu/pixiu-api/pkg/router"
-)
-
import (
"github.com/apache/dubbo-go-pixiu/pkg/common/constant"
+ apiConf "github.com/apache/dubbo-go-pixiu/pkg/config"
Review Comment:
ditto
##########
pkg/config/api_config.go:
##########
@@ -466,3 +464,237 @@ func getCheckRatelimitRegexp() *regexp.Regexp {
func RegisterConfigListener(li APIConfigResourceListener) {
listener = li
}
+
+// HTTPVerb defines the restful api http verb
+type HTTPVerb string
+
+const (
+ // MethodAny any method
+ MethodAny HTTPVerb = "ANY"
+ // MethodGet get
+ MethodGet HTTPVerb = "GET"
+ // MethodHead head
+ MethodHead HTTPVerb = "HEAD"
+ // MethodPost post
+ MethodPost HTTPVerb = "POST"
+ // MethodPut put
+ MethodPut HTTPVerb = "PUT"
+ // MethodPatch patch
+ MethodPatch HTTPVerb = "PATCH" // RFC 5789
+ // MethodDelete delete
+ MethodDelete HTTPVerb = "DELETE"
+ // MethodOptions options
+ MethodOptions HTTPVerb = "OPTIONS"
+)
+
+// RequestType describes the type of the request. could be DUBBO/HTTP and
others that we might implement in the future
+type RequestType string
+
+const (
+ // DubboRequest represents the dubbo request
+ DubboRequest RequestType = "dubbo"
+ // HTTPRequest represents the http request
+ HTTPRequest RequestType = "http"
+ // GRPCRequest represents the grpc request
+ GRPCRequest RequestType = "grpc"
+)
Review Comment:
ditto
##########
pkg/config/xds/lds_test.go:
##########
@@ -33,6 +31,7 @@ import (
)
import (
+ model2 "github.com/apache/dubbo-go-pixiu/pkg/config/xds/model"
Review Comment:
ditto
##########
pkg/filter/http/remote/resolver/dubboresolver/dubbo_resolver_test.go:
##########
@@ -24,15 +24,14 @@ import (
)
import (
- apiConf "github.com/dubbo-go-pixiu/pixiu-api/pkg/api/config"
- "github.com/dubbo-go-pixiu/pixiu-api/pkg/router"
-
"github.com/stretchr/testify/assert"
)
import (
"github.com/apache/dubbo-go-pixiu/pkg/common/constant"
+ apiConf "github.com/apache/dubbo-go-pixiu/pkg/config"
Review Comment:
ditto
##########
pkg/filter/http/remote/resolver/dubboresolver/dubbo_resolver.go:
##########
@@ -18,14 +18,11 @@
package dubboresolver
import (
- apiConf "github.com/dubbo-go-pixiu/pixiu-api/pkg/api/config"
- "github.com/dubbo-go-pixiu/pixiu-api/pkg/router"
-)
-
-import (
+ apiConf "github.com/apache/dubbo-go-pixiu/pkg/config"
Review Comment:
```suggestion
"github.com/apache/dubbo-go-pixiu/pkg/config"
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]