对接 context

This commit is contained in:
黄孟柱
2022-07-20 15:35:04 +08:00
parent a74e9bb70b
commit a59cff3577
61 changed files with 230 additions and 141 deletions

View File

@@ -2,13 +2,14 @@ package proxy_rewrite
import (
"fmt"
"github.com/eolinker/eosc/context"
"regexp"
"github.com/eolinker/eosc"
http_service "github.com/eolinker/eosc/http-service"
http_service "github.com/eolinker/eosc/context/http-context"
)
var _ http_service.IFilter = (*ProxyRewrite)(nil)
var _ http_service.HttpFilter = (*ProxyRewrite)(nil)
type ProxyRewrite struct {
*Driver
@@ -21,7 +22,7 @@ type ProxyRewrite struct {
headers map[string]string
}
func (p *ProxyRewrite) DoFilter(ctx http_service.IHttpContext, next http_service.IChain) (err error) {
func (p *ProxyRewrite) DoHttpFilter(ctx http_service.IHttpContext, next context.IChain) (err error) {
err = p.rewrite(ctx)
if err != nil {
return err