diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-10-29 18:24:58 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-10-29 18:24:58 +0900 |
commit | 0b4d946298c6aca479dc79b578adb9ae0da1a850 (patch) | |
tree | 263fde5bfb40708996b18f1c0c2eecd5a77418e4 /pkg/server/sockopt.go | |
parent | 4cd45f42f9b29e4d7a86f8aa271b7b38aefeae87 (diff) |
server: unexport TCPDialer/TCPListener/TCPSockopt stuff
No need to export them. Also fixed golint errors.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'pkg/server/sockopt.go')
-rw-r--r-- | pkg/server/sockopt.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pkg/server/sockopt.go b/pkg/server/sockopt.go index e1c9c467..8061f41a 100644 --- a/pkg/server/sockopt.go +++ b/pkg/server/sockopt.go @@ -23,49 +23,49 @@ import ( log "github.com/sirupsen/logrus" ) -func SetTcpMD5SigSockopt(l *net.TCPListener, address string, key string) error { +func setTCPMD5SigSockopt(l *net.TCPListener, address string, key string) error { return setTcpMD5SigSockopt(l, address, key) } -func SetListenTcpTTLSockopt(l *net.TCPListener, ttl int) error { +func setListenTCPTTLSockopt(l *net.TCPListener, ttl int) error { return setListenTcpTTLSockopt(l, ttl) } -func SetTcpTTLSockopt(conn *net.TCPConn, ttl int) error { +func setTCPTTLSockopt(conn *net.TCPConn, ttl int) error { return setTcpTTLSockopt(conn, ttl) } -func SetTcpMinTTLSockopt(conn *net.TCPConn, ttl int) error { +func setTCPMinTTLSockopt(conn *net.TCPConn, ttl int) error { return setTcpMinTTLSockopt(conn, ttl) } -type TCPDialer struct { +type tcpDialer struct { net.Dialer // MD5 authentication password. AuthPassword string // The TTL value to set outgoing connection. - Ttl uint8 + TTL uint8 // The minimum TTL value for incoming packets. - TtlMin uint8 + TTLMin uint8 } -func (d *TCPDialer) DialTCP(addr string, port int) (*net.TCPConn, error) { +func (d *tcpDialer) DialTCP(addr string, port int) (*net.TCPConn, error) { if d.AuthPassword != "" { log.WithFields(log.Fields{ "Topic": "Peer", "Key": addr, }).Warn("setting md5 for active connection is not supported") } - if d.Ttl != 0 { + if d.TTL != 0 { log.WithFields(log.Fields{ "Topic": "Peer", "Key": addr, }).Warn("setting ttl for active connection is not supported") } - if d.TtlMin != 0 { + if d.TTLMin != 0 { log.WithFields(log.Fields{ "Topic": "Peer", "Key": addr, |