Merge branch 'release/v0.8.2' into develop

# Conflicts:
#	build/resources/apinto.yml
#	build/resources/config.yml.tmp
#	drivers/app/app.go
#	drivers/app/manager/manager.go
#	drivers/discovery/consul/consul.go
#	drivers/discovery/eureka/eureka.go
#	drivers/discovery/nacos/nacos.go
#	drivers/plugins/app/app.go
#	drivers/router/http-router/http-handler.go
#	drivers/router/http-router/manager/manager.go
#	go.mod
This commit is contained in:
Liujian
2022-11-04 17:25:49 +08:00
17 changed files with 216 additions and 52 deletions

63
.github/workflows/actions.yaml vendored Normal file
View File

@@ -0,0 +1,63 @@
name: packAndDockerImages
#触发机制当main分支有创建tag时
on:
release:
types:
- published
jobs:
releasePackage:
name: releaseOnGithub
runs-on: ubuntu-latest
steps:
- name: SetOutput #处理Tag字符串并存进outputs
id: vars
run: |
echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT
- name: SetUpGo
uses: actions/setup-go@v3
with:
go-version: '1.17.3'
- name: Checkout #Checkout代码
uses: actions/checkout@v3
- name: GoTidy
run: go mod tidy
- name: Create archives on Release #创建各种系统架构下的二进制包并上传至release assets
uses: goreleaser/goreleaser-action@v3.1.0
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dockerImage:
needs: [releasePackage]
name: buildDockerImage
runs-on: ubuntu-latest
steps:
- name: SetupGo
uses: actions/setup-go@v3
with:
go-version: '1.17.3'
- uses: actions/checkout@v3
- name: SetOutput
id: vars
run: echo "tag=${GITHUB_REF#refs/*/v}" >> $GITHUB_OUTPUT
- name: GoTidy
run: |
go mod tidy
- name: Pack #运行打包脚本并且将生成的tar包复制至Dockerfile所在目录
run: |
./build/cmd/package.sh ${{ steps.vars.outputs.tag }}
cp ./out/apinto-${{ steps.vars.outputs.tag }}.linux.x64.tar.gz ./build/resources/apinto.linux.x64.tar.gz
- name: Login Docker #登录docker
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: buildImage
run: |
docker build -t ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:${{ steps.vars.outputs.tag }} -f ./build/resources/Dockerfile ./build/resources
- name: pushImage
run: |
docker push ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:${{ steps.vars.outputs.tag }}
docker tag ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:${{ steps.vars.outputs.tag }} ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:latest
docker push ${{ secrets.DOCKER_USERNAME }}/apinto-gateway:latest

41
.goreleaser.yaml Normal file
View File

@@ -0,0 +1,41 @@
# .goreleaser.yml
builds:
- id: apinto
goos:
- linux
- darwin
goarch:
- amd64
- arm64
- "386"
goarm:
- "6"
gomips:
- hardfloat
goamd64:
- v1
targets:
- linux_arm64
- linux_amd64
- linux_386
- darwin_arm64
- darwin_amd64
dir: ./app/apinto
main: .
binary: apinto
builder: go
gobinary: go
ldflags:
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser
archives:
- id: default
format: tar.gz
wrap_in_directory: apinto
name_template: "{{ .ProjectName }}_{{ .Tag }}_{{ .Os }}_{{ .Arch }}"
files:
- src: 'build/resources/*'
dst: /
strip_parent: true
release:
name_template: "{{ .Tag }}"
mode: append

View File

@@ -9,6 +9,8 @@ Apinto is a microservice gateway developed based on golang. It can achieve the p
**Note**The **main** branch is the main development branch. Frequent updates may lead to unstable use. If you need to use a stable version, please look [release](https://github.com/eolinker/apinto/releases) **Note**The **main** branch is the main development branch. Frequent updates may lead to unstable use. If you need to use a stable version, please look [release](https://github.com/eolinker/apinto/releases)
**Apinto** integrates configuration and forwarding functions. Users can configure it through OpenAPI or through visual UI items [apinto dashboard](https://github.com/eolinker/apinto-dashboard) for configuration, click [apinto dashboard deployment document](https://help.apinto.com/docs/dashboard/quick/arrange) for relevant documents
### Summary / [中文介绍](https://github.com/eolinker/apinto/blob/main/README_CN.md) ### Summary / [中文介绍](https://github.com/eolinker/apinto/blob/main/README_CN.md)
- [Why Apinto](#WhyApinto "Why Apinto") - [Why Apinto](#WhyApinto "Why Apinto")
@@ -33,7 +35,10 @@ Apinto API gateway has the following advantages:
In a word, Apinto API gateway enables the business development team to focus more on business implementation. In a word, Apinto API gateway enables the business development team to focus more on business implementation.
[![Stargazers over time](https://starchart.cc/eolinker/apinto.svg)](#) ### Star History
[![Star History Chart](https://api.star-history.com/svg?repos=eolinker/apinto&type=Date)](https://star-history.com/#eolinker/apinto&Date)
### Feture ### Feture
@@ -80,18 +85,18 @@ In a word, Apinto API gateway enables the business development team to focus mor
### Deployment ### Deployment
* Direct Deployment[Deployment Tutorial](https://help-apinto.eolink.com/?path=/quick/arrange) * Direct Deployment[Deployment Tutorial](https://help.apinto.com/docs/apinto/quick/arrange.html)
* [Quick Start Tutorial](https://help-apinto.eolink.com/?path=/quick/quick_course) * [Quick Start Tutorial](https://help.apinto.com/docs/apinto/quick/quick_course.html)
* [Source Code Compilation Tutorial](https://help-apinto.eolink.com/?path=/quick/arrange) * [Source Code Compilation Tutorial](https://help.apinto.com/docs/apinto/quick/arrange.html)
* DockerFollow up support * [Docker](https://hub.docker.com/r/eolinker/apinto-gateway)
* KubernetesFollow up support * KubernetesFollow up support
### Get start ### Get start
1. Download and unzip the installation package (here is an example of the installation package of version v0.5.1) 1. Download and unzip the installation package (here is an example of the installation package of version v0.8.0)
``` ```
wget https://github.com/eolinker/apinto/releases/download/v0.5.1/apinto-v0.5.1.linux.x64.tar.gz && tar -zxvf apinto-v0.5.1.linux.x64.tar.gz && cd apinto wget https://github.com/eolinker/apinto/releases/download/v0.8.0/apinto-v0.8.0.linux.x64.tar.gz && tar -zxvf apinto-v0.8.0.linux.x64.tar.gz && cd apinto
``` ```
2. Start gateway 2. Start gateway
@@ -100,8 +105,10 @@ wget https://github.com/eolinker/apinto/releases/download/v0.5.1/apinto-v0.5.1.l
./apinto start ./apinto start
``` ```
3.To configure the gateway through the visual interface, click [apinto dashboard](https://github.com/eolinker/apinto-dashboard)
### Contact ### Contact
- **Help documentation**[https://help.apinto.com](https://help.apinto.com) - **Help documentation**[https://help.apinto.com](https://help.apinto.com/docs)
- **QQ group**: 725853895 - **QQ group**: 725853895
- **Slack**[Join us](https://join.slack.com/t/slack-zer6755/shared_invite/zt-u7wzqp1u-aNA0XK9Bdb3kOpN03jRmYQ) - **Slack**[Join us](https://join.slack.com/t/slack-zer6755/shared_invite/zt-u7wzqp1u-aNA0XK9Bdb3kOpN03jRmYQ)
- **Official website**[https://www.apinto.com](https://www.apinto.com) - **Official website**[https://www.apinto.com](https://www.apinto.com)

View File

@@ -11,6 +11,7 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT
注意:**main**分支为开发主要分支,频繁更新可能导致使用不稳定,若需要使用稳定版本,请查看[release](https://github.com/eolinker/apinto/releases) 注意:**main**分支为开发主要分支,频繁更新可能导致使用不稳定,若需要使用稳定版本,请查看[release](https://github.com/eolinker/apinto/releases)
**Apinto** 集合了配置和转发功能使用者可以通过openAPI进行配置也可通过可视化UI项目[Apinto Dashboard](https://github.com/eolinker/apinto-dashboard)进行配置,相关文档可点击[Apinto Dashboard部署文档](https://help.apinto.com/docs/dashboard/quick/arrange)
### 概况 | [English Introduction](https://github.com/eolinker/apinto/blob/main/README.md) ### 概况 | [English Introduction](https://github.com/eolinker/apinto/blob/main/README.md)
- [为什么要使用Apinto](#为什么要使用Apinto "Apinto") - [为什么要使用Apinto](#为什么要使用Apinto "Apinto")
@@ -36,7 +37,10 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT
总而言之Apinto 能让业务开发团队更加专注地实现业务。 总而言之Apinto 能让业务开发团队更加专注地实现业务。
[![Stargazers over time](https://starchart.cc/eolinker/apinto.svg)](#) ### Star 历史
[![Star History Chart](https://api.star-history.com/svg?repos=eolinker/apinto&type=Date)](https://star-history.com/#eolinker/apinto&Date)
### 产品特性 ### 产品特性
@@ -84,18 +88,18 @@ Apinto是一个基于 Golang 开发的微服务网关,能够实现高性能 HT
### 部署 ### 部署
* 直接部署:[部署教程](https://help.apinto.com/?path=/quick/arrange) * 直接部署:[部署教程](https://help.apinto.com/docs/apinto/quick/arrange)
* [快速入门教程](https://help.apinto.com/?path=/quick/quick_course) * [快速入门教程](https://help.apinto.com/docs/apinto/quick/quick_course)
* [源码编译教程](https://help.apinto.com/?path=/quick/arrange) * [源码编译教程](https://help.apinto.com/docs/apinto/quick/arrange)
* Docker部署:后续支持 * [Docker部署](https://hub.docker.com/r/eolinker/apinto-gateway)
* Kubernetes部署后续支持 * Kubernetes部署后续支持
### 启动 ### 启动
1.下载安装包并解压此处以v0.5.1版本的安装包示例) 1.下载安装包并解压此处以v0.8.0版本的安装包示例)
``` ```
wget https://github.com/eolinker/apinto/releases/download/v0.5.1/apinto-v0.5.1.linux.x64.tar.gz && tar -zxvf apinto-v0.5.1.linux.x64.tar.gz && cd apinto wget https://github.com/eolinker/apinto/releases/download/v0.8.0/apinto-v0.8.0.linux.x64.tar.gz && tar -zxvf apinto-v0.8.0.linux.x64.tar.gz && cd apinto
``` ```
2.启动网关: 2.启动网关:
@@ -104,10 +108,13 @@ wget https://github.com/eolinker/apinto/releases/download/v0.5.1/apinto-v0.5.1.l
./apinto start ./apinto start
``` ```
3.如需可视化界面请点击[Apinto Dashboard](https://github.com/eolinker/apinto-dashboard)
- ### **联系我们** - ### **联系我们**
* **帮助文档**[https://help.apinto.com](https://help.apinto.com/) * **帮助文档**[https://help.apinto.com](https://help.apinto.com/docs)
- **QQ群**: 725853895 - **QQ群**: 725853895

View File

@@ -6,3 +6,4 @@ apinto*
/apinto /apinto
/tmp/ /tmp/
/tmp_bak/ /tmp_bak/
/logs/

View File

@@ -24,7 +24,6 @@ func init() {
type IApp interface { type IApp interface {
Id() string Id() string
Name() string
Labels() map[string]string Labels() map[string]string
Disable() bool Disable() bool
IAppExecutor IAppExecutor

View File

@@ -0,0 +1,29 @@
# 数据文件放置目录
# data_dir: /var/lib/apinto
# pid文件放置地址
# pid_dir: /var/run/apinto/
# 日志放置目录
# log_dir: /var/log/apinto
# socket放置目录
# socket_dir: /tmp/apinto
# apinto运行配置地址
# config: /etc/apinto/config.yml
# 扩展仓库目录
# extends_dir: /var/lib/apinto/extenders/
# 错误日志文件名
# error_log_name: error.log
# 错误日志等级
# error_log_level: error
# 错误日志过期时间默认单位为天d|天h|小时
# error_log_expire: 7d
# 错误日志切割周期仅支持day、hour
# error_log_period: day

View File

@@ -0,0 +1,7 @@
listen: # node listen port
- 8099
admin: # openAPI request info
scheme: http # listen scheme
listen: 9400 # listen port
ip: 0.0.0.0 # listen ip

View File

@@ -33,6 +33,9 @@ func checkConfig(v interface{}) (*Config, error) {
if conf.Anonymous && len(conf.Auth) > 0 { if conf.Anonymous && len(conf.Auth) > 0 {
return nil, errors.New("it is anonymous app,auths should be empty") return nil, errors.New("it is anonymous app,auths should be empty")
} }
if conf.Anonymous && len(conf.Auth) > 0 {
return nil, errors.New("it is anonymous app,auths should be empty")
}
for _, a := range conf.Auth { for _, a := range conf.Auth {
err := application.CheckPosition(a.Position) err := application.CheckPosition(a.Position)
if err != nil { if err != nil {

View File

@@ -25,7 +25,7 @@ type consul struct {
cancelFunc context.CancelFunc cancelFunc context.CancelFunc
} }
//Start 开始服务发现 // Start 开始服务发现
func (c *consul) Start() error { func (c *consul) Start() error {
ctx, cancelFunc := context.WithCancel(context.Background()) ctx, cancelFunc := context.WithCancel(context.Background())
c.context = ctx c.context = ctx
@@ -65,7 +65,7 @@ func (c *consul) Start() error {
return nil return nil
} }
//Reset 重置consul实例配置 // Reset 重置consul实例配置
func (c *consul) Reset(cfg interface{}, workers map[eosc.RequireId]eosc.IWorker) error { func (c *consul) Reset(cfg interface{}, workers map[eosc.RequireId]eosc.IWorker) error {
workerConfig, ok := cfg.(*Config) workerConfig, ok := cfg.(*Config)
if !ok { if !ok {
@@ -78,13 +78,13 @@ func (c *consul) Reset(cfg interface{}, workers map[eosc.RequireId]eosc.IWorker)
return nil return nil
} }
//Stop 停止服务发现 // Stop 停止服务发现
func (c *consul) Stop() error { func (c *consul) Stop() error {
c.cancelFunc() c.cancelFunc()
return nil return nil
} }
//Remove 从所有服务app中移除目标app // Remove 从所有服务app中移除目标app
func (c *consul) Remove(id string) error { func (c *consul) Remove(id string) error {
c.locker.Lock() c.locker.Lock()
defer c.locker.Unlock() defer c.locker.Unlock()
@@ -95,7 +95,7 @@ func (c *consul) Remove(id string) error {
return nil return nil
} }
//GetApp 获取服务发现中目标服务的app // GetApp 获取服务发现中目标服务的app
func (c *consul) GetApp(serviceName string) (discovery.IApp, error) { func (c *consul) GetApp(serviceName string) (discovery.IApp, error) {
var err error var err error
var has bool var has bool
@@ -108,8 +108,8 @@ func (c *consul) GetApp(serviceName string) (discovery.IApp, error) {
if !has { if !has {
nodes, err = c.clients.getNodes(serviceName) nodes, err = c.clients.getNodes(serviceName)
if err != nil { if err != nil {
c.locker.Unlock() log.Errorf("%s get %s node list error: %v", driverName, serviceName, err)
return nil, err nodes = make(discovery.Nodes)
} }
c.nodes.Set(serviceName, nodes) c.nodes.Set(serviceName, nodes)
@@ -126,7 +126,7 @@ func (c *consul) GetApp(serviceName string) (discovery.IApp, error) {
return app, nil return app, nil
} }
//Create 创建目标服务的app // Create 创建目标服务的app
func (c *consul) Create(serviceName string, attrs map[string]string, nodes map[string]discovery.INode) (discovery.IApp, error) { func (c *consul) Create(serviceName string, attrs map[string]string, nodes map[string]discovery.INode) (discovery.IApp, error) {
return discovery.NewApp(nil, c, attrs, nodes), nil return discovery.NewApp(nil, c, attrs, nodes), nil
} }

View File

@@ -8,6 +8,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/eolinker/eosc/utils/config"
"github.com/eolinker/eosc/log" "github.com/eolinker/eosc/log"
"github.com/eolinker/apinto/discovery" "github.com/eolinker/apinto/discovery"
@@ -24,7 +26,7 @@ type eureka struct {
locker sync.RWMutex locker sync.RWMutex
} }
//GetApp 获取服务发现中目标服务的app // GetApp 获取服务发现中目标服务的app
func (e *eureka) GetApp(serviceName string) (discovery.IApp, error) { func (e *eureka) GetApp(serviceName string) (discovery.IApp, error) {
e.locker.RLock() e.locker.RLock()
nodes, ok := e.nodes.Get(serviceName) nodes, ok := e.nodes.Get(serviceName)
@@ -36,8 +38,8 @@ func (e *eureka) GetApp(serviceName string) (discovery.IApp, error) {
// 开始重新获取 // 开始重新获取
ns, err := e.client.GetNodeList(serviceName) ns, err := e.client.GetNodeList(serviceName)
if err != nil { if err != nil {
e.locker.Unlock() log.Errorf("%s get %s node list error: %v", driverName, serviceName, err)
return nil, err ns = make(discovery.Nodes)
} }
e.nodes.Set(serviceName, ns) e.nodes.Set(serviceName, ns)
nodes = ns nodes = ns
@@ -50,7 +52,7 @@ func (e *eureka) GetApp(serviceName string) (discovery.IApp, error) {
return app, nil return app, nil
} }
//Remove 从所有服务app中移除目标app // Remove 从所有服务app中移除目标app
func (e *eureka) Remove(id string) error { func (e *eureka) Remove(id string) error {
e.locker.Lock() e.locker.Lock()
defer e.locker.Unlock() defer e.locker.Unlock()
@@ -99,7 +101,7 @@ func (e *eureka) Start() error {
return nil return nil
} }
//Reset 重置eureka实例配置 // Reset 重置eureka实例配置
func (e *eureka) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error { func (e *eureka) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error {
cfg, ok := conf.(*Config) cfg, ok := conf.(*Config)
if !ok { if !ok {
@@ -109,13 +111,13 @@ func (e *eureka) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker
return nil return nil
} }
//Stop 停止服务发现 // Stop 停止服务发现
func (e *eureka) Stop() error { func (e *eureka) Stop() error {
e.cancelFunc() e.cancelFunc()
return nil return nil
} }
//CheckSkill 检查目标能力是否存在 // CheckSkill 检查目标能力是否存在
func (e *eureka) CheckSkill(skill string) bool { func (e *eureka) CheckSkill(skill string) bool {
return discovery.CheckSkill(skill) return discovery.CheckSkill(skill)
} }

View File

@@ -8,6 +8,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/eolinker/eosc/utils/config"
"github.com/eolinker/eosc/log" "github.com/eolinker/eosc/log"
"github.com/eolinker/apinto/discovery" "github.com/eolinker/apinto/discovery"
@@ -28,7 +30,7 @@ type nacos struct {
locker sync.RWMutex locker sync.RWMutex
} }
//Instance nacos 服务实例结构 // Instance nacos 服务实例结构
type Instance struct { type Instance struct {
Hosts []struct { Hosts []struct {
Valid bool `json:"valid"` Valid bool `json:"valid"`
@@ -45,7 +47,7 @@ func (n *nacos) CheckSkill(skill string) bool {
return discovery.CheckSkill(skill) return discovery.CheckSkill(skill)
} }
//Start 开始服务发现 // Start 开始服务发现
func (n *nacos) Start() error { func (n *nacos) Start() error {
ctx, cancelFunc := context.WithCancel(context.Background()) ctx, cancelFunc := context.WithCancel(context.Background())
n.context = ctx n.context = ctx
@@ -83,7 +85,7 @@ func (n *nacos) Start() error {
return nil return nil
} }
//Reset 重置nacos实例配置 // Reset 重置nacos实例配置
func (n *nacos) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error { func (n *nacos) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker) error {
cfg, ok := conf.(*Config) cfg, ok := conf.(*Config)
if !ok { if !ok {
@@ -93,13 +95,13 @@ func (n *nacos) Reset(conf interface{}, workers map[eosc.RequireId]eosc.IWorker)
return nil return nil
} }
//Stop 停止服务发现 // Stop 停止服务发现
func (n *nacos) Stop() error { func (n *nacos) Stop() error {
n.cancelFunc() n.cancelFunc()
return nil return nil
} }
//Remove 从所有服务app中移除目标app // Remove 从所有服务app中移除目标app
func (n *nacos) Remove(id string) error { func (n *nacos) Remove(id string) error {
n.locker.Lock() n.locker.Lock()
defer n.locker.Unlock() defer n.locker.Unlock()
@@ -110,7 +112,7 @@ func (n *nacos) Remove(id string) error {
return nil return nil
} }
//GetApp 获取服务发现中目标服务的app // GetApp 获取服务发现中目标服务的app
func (n *nacos) GetApp(serviceName string) (discovery.IApp, error) { func (n *nacos) GetApp(serviceName string) (discovery.IApp, error) {
n.locker.RLock() n.locker.RLock()
nodes, ok := n.nodes.Get(serviceName) nodes, ok := n.nodes.Get(serviceName)
@@ -121,8 +123,8 @@ func (n *nacos) GetApp(serviceName string) (discovery.IApp, error) {
if !ok { if !ok {
ns, err := n.client.GetNodeList(serviceName) ns, err := n.client.GetNodeList(serviceName)
if err != nil { if err != nil {
n.locker.Unlock() log.Errorf("%s get %s node list error: %v", driverName, serviceName, err)
return nil, err ns = make(discovery.Nodes)
} }
n.nodes.Set(serviceName, ns) n.nodes.Set(serviceName, ns)

View File

@@ -60,14 +60,14 @@ func (a *App) DoWebsocketFilter(ctx http_service.IWebsocketContext, next eoconte
} }
func (a *App) auth(ctx http_service.IHttpContext) error { func (a *App) auth(ctx http_service.IHttpContext) error {
driver := ctx.Request().Header().GetHeader("Authorization-Type") if appManager.Count() < 1 {
filters := appManager.ListByDriver(driver)
if len(filters) < 1 {
if appManager.Count() > 0 {
filters = appManager.List()
} else {
return nil return nil
} }
driver := ctx.Request().Header().GetHeader("Authorization-Type")
filters := appManager.ListByDriver(driver)
if len(filters) < 1 {
filters = appManager.List()
} }
for _, filter := range filters { for _, filter := range filters {
user, ok := filter.GetUser(ctx) user, ok := filter.GetUser(ctx)

View File

@@ -3,11 +3,12 @@ package http_complete
import ( import (
"errors" "errors"
"fmt" "fmt"
"strings"
"time"
"github.com/eolinker/eosc/eocontext" "github.com/eolinker/eosc/eocontext"
http_service "github.com/eolinker/eosc/eocontext/http-context" http_service "github.com/eolinker/eosc/eocontext/http-context"
"github.com/eolinker/eosc/log" "github.com/eolinker/eosc/log"
"strings"
"time"
) )
var ( var (
@@ -60,8 +61,9 @@ func (h *HttpComplete) Complete(org eocontext.EoContext) error {
} }
node, err := balance.Select(ctx) node, err := balance.Select(ctx)
if err != nil { if err != nil {
log.Error("select error: ", lastErr) log.Error("select error: ", err)
ctx.Response().SetStatus(501, "501")
ctx.Response().SetBody([]byte(err.Error()))
return err return err
} }

View File

@@ -62,5 +62,4 @@ func (h *httpHandler) ServeHTTP(ctx eocontext.EoContext) {
ctx.SetUpstreamHostHandler(h.service) ctx.SetUpstreamHostHandler(h.service)
h.filters.Chain(ctx, completeCaller) h.filters.Chain(ctx, completeCaller)
ctx.GetFinish().Finish(ctx)
} }

View File

@@ -122,8 +122,10 @@ func (m *Manager) FastHandler(port int, ctx *fasthttp.RequestCtx) {
log.Debug("match has:", port) log.Debug("match has:", port)
r.ServeHTTP(httpContext) r.ServeHTTP(httpContext)
} }
//} httpContext.GetFinish().Finish(httpContext)
}
type NotFoundHandler struct {
} }
type HttpNotFoundHandler struct { type HttpNotFoundHandler struct {

2
go.mod
View File

@@ -109,4 +109,4 @@ require (
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
) )
replace github.com/eolinker/eosc => ../eosc //replace github.com/eolinker/eosc => ../eosc