mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #5075 from xiang90/p
proxy: move http related thing to httpproxy
This commit is contained in:
commit
ac95cc32ef
@ -39,7 +39,7 @@ import (
|
||||
runtimeutil "github.com/coreos/etcd/pkg/runtime"
|
||||
"github.com/coreos/etcd/pkg/transport"
|
||||
"github.com/coreos/etcd/pkg/types"
|
||||
"github.com/coreos/etcd/proxy"
|
||||
"github.com/coreos/etcd/proxy/httpproxy"
|
||||
"github.com/coreos/etcd/rafthttp"
|
||||
"github.com/coreos/etcd/version"
|
||||
"github.com/coreos/go-systemd/daemon"
|
||||
@ -391,7 +391,7 @@ func startProxy(cfg *config) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
pt.MaxIdleConnsPerHost = proxy.DefaultMaxIdleConnsPerHost
|
||||
pt.MaxIdleConnsPerHost = httpproxy.DefaultMaxIdleConnsPerHost
|
||||
|
||||
tr, err := transport.NewTimeoutTransport(cfg.peerTLSInfo, time.Duration(cfg.proxyDialTimeoutMs)*time.Millisecond, time.Duration(cfg.proxyReadTimeoutMs)*time.Millisecond, time.Duration(cfg.proxyWriteTimeoutMs)*time.Millisecond)
|
||||
if err != nil {
|
||||
@ -484,14 +484,14 @@ func startProxy(cfg *config) error {
|
||||
|
||||
return clientURLs
|
||||
}
|
||||
ph := proxy.NewHandler(pt, uf, time.Duration(cfg.proxyFailureWaitMs)*time.Millisecond, time.Duration(cfg.proxyRefreshIntervalMs)*time.Millisecond)
|
||||
ph := httpproxy.NewHandler(pt, uf, time.Duration(cfg.proxyFailureWaitMs)*time.Millisecond, time.Duration(cfg.proxyRefreshIntervalMs)*time.Millisecond)
|
||||
ph = &cors.CORSHandler{
|
||||
Handler: ph,
|
||||
Info: cfg.corsInfo,
|
||||
}
|
||||
|
||||
if cfg.isReadonlyProxy() {
|
||||
ph = proxy.NewReadonlyHandler(ph)
|
||||
ph = httpproxy.NewReadonlyHandler(ph)
|
||||
}
|
||||
// Start a proxy server goroutine for each listen address
|
||||
for _, u := range cfg.lcurls {
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package proxy
|
||||
package httpproxy
|
||||
|
||||
import (
|
||||
"log"
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package proxy
|
||||
package httpproxy
|
||||
|
||||
import (
|
||||
"net/url"
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package proxy implements etcd proxy node. The etcd proxy acts as a reverse
|
||||
// proxy forwarding client requests to active etcd cluster members, and does
|
||||
// Package httpproxy implements etcd httpproxy. The etcd proxy acts as a reverse
|
||||
// http proxy forwarding client requests to active etcd cluster members, and does
|
||||
// not participate in consensus.
|
||||
package proxy
|
||||
package httpproxy
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package proxy
|
||||
package httpproxy
|
||||
|
||||
import (
|
||||
"net/http"
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package proxy
|
||||
package httpproxy
|
||||
|
||||
import (
|
||||
"encoding/json"
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package proxy
|
||||
package httpproxy
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package proxy
|
||||
package httpproxy
|
||||
|
||||
import (
|
||||
"bytes"
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package proxy
|
||||
package httpproxy
|
||||
|
||||
import (
|
||||
"bytes"
|
2
test
2
test
@ -28,7 +28,7 @@ ln -s ${PWD}/cmd/vendor $GOPATH/src
|
||||
|
||||
# Hack: gofmt ./ will recursively check the .git directory. So use *.go for gofmt.
|
||||
PKGS=`ls pkg/*/*go | cut -f1,2 -d/ | sort | uniq`
|
||||
TESTABLE_AND_FORMATTABLE="client clientv3 discovery error etcdctl/ctlv2 etcdctl/ctlv3 etcdmain etcdserver etcdserver/auth etcdserver/api/v2http etcdserver/api/v2http/httptypes $PKGS proxy raft snap storage storage/backend store version wal"
|
||||
TESTABLE_AND_FORMATTABLE="client clientv3 discovery error etcdctl/ctlv2 etcdctl/ctlv3 etcdmain etcdserver etcdserver/auth etcdserver/api/v2http etcdserver/api/v2http/httptypes $PKGS proxy/httpproxy raft snap storage storage/backend store version wal"
|
||||
# TODO: add it to race testing when the issue is resolved
|
||||
# https://github.com/golang/go/issues/9946
|
||||
NO_RACE_TESTABLE="rafthttp"
|
||||
|
Loading…
x
Reference in New Issue
Block a user