This repository was archived by the owner on Apr 1, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- module github.com/dubbogo/dubbo-go-proxy-common
1+ module github.com/dubbogo/dubbo-go-proxy-filter
22
33go 1.14
44
Original file line number Diff line number Diff line change 1515 * limitations under the License.
1616 */
1717
18- package model
18+ package api
1919
2020import (
2121 "sync"
Original file line number Diff line number Diff line change 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
3331const (
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}
File renamed without changes.
Original file line number Diff line number Diff line change 1818package context
1919
2020import (
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
Original file line number Diff line number Diff line change 1717
1818package 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.
2323type Filter interface {
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments