Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions lib/proxy/clusterdial/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@ package clusterdial
import (
"net"

"github.com/gravitational/teleport/lib/proxy"
"github.com/gravitational/teleport/lib/reversetunnel"
"github.com/gravitational/trace"

"github.com/gravitational/teleport/lib/proxy/peer"
"github.com/gravitational/teleport/lib/reversetunnel"
)

// ClusterDialerFunc is a function that implements a proxy.ClusterDialer.
type ClusterDialerFunc func(clusterName string, request proxy.DialParams) (net.Conn, error)
// ClusterDialerFunc is a function that implements a peer.ClusterDialer.
type ClusterDialerFunc func(clusterName string, request peer.DialParams) (net.Conn, error)

// Dial dials makes a dial request to the given cluster.
func (f ClusterDialerFunc) Dial(clusterName string, request proxy.DialParams) (net.Conn, error) {
func (f ClusterDialerFunc) Dial(clusterName string, request peer.DialParams) (net.Conn, error) {
return f(clusterName, request)
}

// NewClusterDialer implements proxy.ClusterDialer for a reverse tunnel server.
func NewClusterDialer(server reversetunnel.Server) ClusterDialerFunc {
return ClusterDialerFunc(func(clusterName string, request proxy.DialParams) (net.Conn, error) {
return func(clusterName string, request peer.DialParams) (net.Conn, error) {
site, err := server.GetSite(clusterName)
if err != nil {
return nil, trace.Wrap(err)
Expand All @@ -51,5 +52,5 @@ func NewClusterDialer(server reversetunnel.Server) ClusterDialerFunc {
return nil, trace.Wrap(err)
}
return conn, nil
})
}
}
2 changes: 1 addition & 1 deletion lib/proxy/auth.go → lib/proxy/peer/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion lib/proxy/client.go → lib/proxy/peer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion lib/proxy/client_test.go → lib/proxy/peer/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"crypto/tls"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"github.com/gravitational/trace"
Expand Down
2 changes: 1 addition & 1 deletion lib/proxy/conn.go → lib/proxy/peer/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion lib/proxy/conn_test.go → lib/proxy/peer/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"crypto/rand"
Expand Down
2 changes: 1 addition & 1 deletion lib/proxy/interceptor.go → lib/proxy/peer/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"context"
Expand Down
2 changes: 1 addition & 1 deletion lib/proxy/reporter.go → lib/proxy/peer/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"time"
Expand Down
2 changes: 1 addition & 1 deletion lib/proxy/server.go → lib/proxy/peer/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"crypto/tls"
Expand Down
2 changes: 1 addition & 1 deletion lib/proxy/server_test.go → lib/proxy/peer/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"github.com/gravitational/trace"
Expand Down
2 changes: 1 addition & 1 deletion lib/proxy/service.go → lib/proxy/peer/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"net"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"context"
Expand Down
4 changes: 2 additions & 2 deletions lib/proxy/stats.go → lib/proxy/peer/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package proxy
package peer

import (
"context"
Expand Down Expand Up @@ -51,7 +51,7 @@ func (s *statsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) con
return ctx
}

// HandleRPC implements per-Connection stats reporting.
// HandleConn implements per-Connection stats reporting.
func (s *statsHandler) HandleConn(ctx context.Context, connStats stats.ConnStats) {
// client connection stats are monitored by the monitor() function in client.go
if connStats.IsClient() {
Expand Down
Loading