mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-26 04:03:11 +00:00
proxy: fix gofmt
violations
Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
parent
610dac2fb7
commit
5dee7f7bfd
@ -4,8 +4,8 @@ package libproxy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
|
||||||
"github.com/djs55/vsock"
|
"github.com/djs55/vsock"
|
||||||
|
"net"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Proxy defines the behavior of a proxy. It forwards traffic back and forth
|
// Proxy defines the behavior of a proxy. It forwards traffic back and forth
|
||||||
@ -25,8 +25,6 @@ type Proxy interface {
|
|||||||
BackendAddr() net.Addr
|
BackendAddr() net.Addr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// NewProxy creates a Proxy according to the specified frontendAddr and backendAddr.
|
// NewProxy creates a Proxy according to the specified frontendAddr and backendAddr.
|
||||||
func NewProxy(frontendAddr *vsock.VsockAddr, backendAddr net.Addr) (Proxy, error) {
|
func NewProxy(frontendAddr *vsock.VsockAddr, backendAddr net.Addr) (Proxy, error) {
|
||||||
switch backendAddr.(type) {
|
switch backendAddr.(type) {
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type udpListener interface {
|
type udpListener interface {
|
||||||
ReadFromUDP(b []byte) (int, *net.UDPAddr, error)
|
ReadFromUDP(b []byte) (int, *net.UDPAddr, error)
|
||||||
WriteToUDP(b []byte, addr *net.UDPAddr) (int, error)
|
WriteToUDP(b []byte, addr *net.UDPAddr) (int, error)
|
||||||
Close() error
|
Close() error
|
||||||
}
|
}
|
||||||
@ -76,15 +76,15 @@ func (u *udpEncapsulator) Close() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewUDPListener(listener net.Listener) udpListener {
|
func NewUDPListener(listener net.Listener) udpListener {
|
||||||
var m sync.Mutex;
|
var m sync.Mutex
|
||||||
var r sync.Mutex;
|
var r sync.Mutex
|
||||||
var w sync.Mutex;
|
var w sync.Mutex
|
||||||
return &udpEncapsulator{
|
return &udpEncapsulator{
|
||||||
conn: nil,
|
conn: nil,
|
||||||
listener: listener,
|
listener: listener,
|
||||||
m: &m,
|
m: &m,
|
||||||
r: &r,
|
r: &r,
|
||||||
w: &w,
|
w: &w,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user