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

Commit

Permalink
clean no need code
Browse files Browse the repository at this point in the history
  • Loading branch information
mark4z committed Jan 13, 2021
1 parent c2e50c9 commit 53765d8
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 400 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/dubbogo/dubbo-go-proxy-common
module github.com/dubbogo/dubbo-go-proxy-filter

go 1.14

Expand Down
2 changes: 1 addition & 1 deletion pkg/model/api.go → pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package model
package api

import (
"sync"
Expand Down
67 changes: 34 additions & 33 deletions pkg/model/match.go → pkg/api/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,47 @@
* limitations under the License.
*/

package model
package api

// StringMatcher matcher string
type StringMatcher struct {
Matcher MatcherType
}
type ApiType int32

// Match
func (sm *StringMatcher) Match() (bool, error) {
return true, nil
}
const (
REST_VALUE = "REST"
GRPC_VALUE = "GRPC"
DUBBO_VALUE = "DUBBO"
)

// MatcherType matcher type
type MatcherType int32
// Status is the components status
type Status int32

const (
Exact MatcherType = 0 + iota
Prefix
Suffix
Regex
Down Status = 0
Up Status = 1
Unknown Status = 2
)

var MatcherTypeName = map[int32]string{
0: "Exact",
1: "Prefix",
2: "Suffix",
3: "Regex",
}
type RequestMethod int32

var MatcherTypeValue = map[string]int32{
"Exact": 0,
"Prefix": 1,
"Suffix": 2,
"Regex": 3,
}
const (
METHOD_UNSPECIFIED = 0 + iota // (DEFAULT)
GET
HEAD
POST
PUT
DELETE
CONNECT
OPTIONS
TRACE
)

// HeaderMatcher header matcher struct
// Name header key, Value header value, Regex header value is regex
type HeaderMatcher struct {
Name string `yaml:"name" json:"name"`
Value string `yaml:"value" json:"value"`
Regex bool `yaml:"regex" json:"regex"`
var RequestMethodValue = map[string]int32{
"METHOD_UNSPECIFIED": 0,
"GET": 1,
"HEAD": 2,
"POST": 3,
"PUT": 4,
"DELETE": 5,
"CONNECT": 6,
"OPTIONS": 7,
"TRACE": 8,
}
File renamed without changes.
8 changes: 4 additions & 4 deletions pkg/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
package context

import (
"github.com/dubbogo/dubbo-go-proxy-common/model"
"github.com/dubbogo/dubbo-go-proxy-common/router"
"github.com/dubbogo/dubbo-go-proxy-filter/pkg/api"
"github.com/dubbogo/dubbo-go-proxy-filter/pkg/router"
)

// Context run context
Expand All @@ -42,8 +42,8 @@ type Context interface {

API(router.API)
GetAPI() *router.API
Api(api *model.Api)
GetApi() *model.Api
Api(api *api.Api)
GetApi() *api.Api

GetClientIP() string
GetApplicationName() string
Expand Down
2 changes: 1 addition & 1 deletion pkg/filter/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package filter

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

// Filter filter interface, used for context.FilterChain.
type Filter interface {
Expand Down
72 changes: 0 additions & 72 deletions pkg/model/authority.go

This file was deleted.

137 changes: 0 additions & 137 deletions pkg/model/base.go

This file was deleted.

Loading

0 comments on commit 53765d8

Please sign in to comment.