mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 09:48:49 +02:00
refactor: rename module route/types to route
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package types
|
||||
package route
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package types_test
|
||||
package route_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
. "github.com/yusing/go-proxy/internal/route"
|
||||
"github.com/yusing/go-proxy/internal/route/types"
|
||||
route "github.com/yusing/go-proxy/internal/route/types"
|
||||
"github.com/yusing/go-proxy/internal/utils"
|
||||
. "github.com/yusing/go-proxy/internal/utils/testing"
|
||||
)
|
||||
@@ -14,14 +14,14 @@ func TestHTTPConfigDeserialize(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
input map[string]any
|
||||
expected types.HTTPConfig
|
||||
expected route.HTTPConfig
|
||||
}{
|
||||
{
|
||||
name: "no_tls_verify",
|
||||
input: map[string]any{
|
||||
"no_tls_verify": "true",
|
||||
},
|
||||
expected: types.HTTPConfig{
|
||||
expected: route.HTTPConfig{
|
||||
NoTLSVerify: true,
|
||||
},
|
||||
},
|
||||
@@ -30,7 +30,7 @@ func TestHTTPConfigDeserialize(t *testing.T) {
|
||||
input: map[string]any{
|
||||
"response_header_timeout": "1s",
|
||||
},
|
||||
expected: types.HTTPConfig{
|
||||
expected: route.HTTPConfig{
|
||||
ResponseHeaderTimeout: 1 * time.Second,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package types
|
||||
package route
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
)
|
||||
|
||||
type Port struct {
|
||||
Listening int `json:"listening"`
|
||||
Proxy int `json:"proxy"`
|
||||
Listening int `json:"listening,omitempty"`
|
||||
Proxy int `json:"proxy,omitempty"`
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package types
|
||||
package route
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package types
|
||||
package route
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/yusing/go-proxy/internal/watcher/health"
|
||||
|
||||
loadbalance "github.com/yusing/go-proxy/internal/net/gphttp/loadbalancer/types"
|
||||
"github.com/yusing/go-proxy/internal/net/gphttp/reverseproxy"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -46,6 +47,10 @@ type (
|
||||
Route
|
||||
http.Handler
|
||||
}
|
||||
ReverseProxyRoute interface {
|
||||
HTTPRoute
|
||||
ReverseProxy() *reverseproxy.ReverseProxy
|
||||
}
|
||||
StreamRoute interface {
|
||||
Route
|
||||
net.Stream
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package types
|
||||
package route
|
||||
|
||||
type RouteType string
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package types
|
||||
package route
|
||||
|
||||
import (
|
||||
"github.com/yusing/go-proxy/internal/gperr"
|
||||
|
||||
Reference in New Issue
Block a user