Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Commit 53765d8

Browse files
committed
clean no need code
1 parent c2e50c9 commit 53765d8

11 files changed

Lines changed: 44 additions & 400 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/dubbogo/dubbo-go-proxy-common
1+
module github.com/dubbogo/dubbo-go-proxy-filter
22

33
go 1.14
44

pkg/model/api.go renamed to pkg/api/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
package model
18+
package api
1919

2020
import (
2121
"sync"
Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,47 @@
1515
* limitations under the License.
1616
*/
1717

18-
package model
18+
package api
1919

20-
// StringMatcher matcher string
21-
type StringMatcher struct {
22-
Matcher MatcherType
23-
}
20+
type ApiType int32
2421

25-
// Match
26-
func (sm *StringMatcher) Match() (bool, error) {
27-
return true, nil
28-
}
22+
const (
23+
REST_VALUE = "REST"
24+
GRPC_VALUE = "GRPC"
25+
DUBBO_VALUE = "DUBBO"
26+
)
2927

30-
// MatcherType matcher type
31-
type MatcherType int32
28+
// Status is the components status
29+
type Status int32
3230

3331
const (
34-
Exact MatcherType = 0 + iota
35-
Prefix
36-
Suffix
37-
Regex
32+
Down Status = 0
33+
Up Status = 1
34+
Unknown Status = 2
3835
)
3936

40-
var MatcherTypeName = map[int32]string{
41-
0: "Exact",
42-
1: "Prefix",
43-
2: "Suffix",
44-
3: "Regex",
45-
}
37+
type RequestMethod int32
4638

47-
var MatcherTypeValue = map[string]int32{
48-
"Exact": 0,
49-
"Prefix": 1,
50-
"Suffix": 2,
51-
"Regex": 3,
52-
}
39+
const (
40+
METHOD_UNSPECIFIED = 0 + iota // (DEFAULT)
41+
GET
42+
HEAD
43+
POST
44+
PUT
45+
DELETE
46+
CONNECT
47+
OPTIONS
48+
TRACE
49+
)
5350

54-
// HeaderMatcher header matcher struct
55-
// Name header key, Value header value, Regex header value is regex
56-
type HeaderMatcher struct {
57-
Name string `yaml:"name" json:"name"`
58-
Value string `yaml:"value" json:"value"`
59-
Regex bool `yaml:"regex" json:"regex"`
51+
var RequestMethodValue = map[string]int32{
52+
"METHOD_UNSPECIFIED": 0,
53+
"GET": 1,
54+
"HEAD": 2,
55+
"POST": 3,
56+
"PUT": 4,
57+
"DELETE": 5,
58+
"CONNECT": 6,
59+
"OPTIONS": 7,
60+
"TRACE": 8,
6061
}

pkg/context/context.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
package context
1919

2020
import (
21-
"github.com/dubbogo/dubbo-go-proxy-common/model"
22-
"github.com/dubbogo/dubbo-go-proxy-common/router"
21+
"github.com/dubbogo/dubbo-go-proxy-filter/pkg/api"
22+
"github.com/dubbogo/dubbo-go-proxy-filter/pkg/router"
2323
)
2424

2525
// Context run context
@@ -42,8 +42,8 @@ type Context interface {
4242

4343
API(router.API)
4444
GetAPI() *router.API
45-
Api(api *model.Api)
46-
GetApi() *model.Api
45+
Api(api *api.Api)
46+
GetApi() *api.Api
4747

4848
GetClientIP() string
4949
GetApplicationName() string

pkg/filter/filter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
package filter
1919

20-
import "github.com/dubbogo/dubbo-go-proxy-common/context"
20+
import "github.com/dubbogo/dubbo-go-proxy-filter/pkg/context"
2121

2222
// Filter filter interface, used for context.FilterChain.
2323
type Filter interface {

pkg/model/authority.go

Lines changed: 0 additions & 72 deletions
This file was deleted.

pkg/model/base.go

Lines changed: 0 additions & 137 deletions
This file was deleted.

0 commit comments

Comments
 (0)