2
0
mirror of https://github.com/soheilhy/cmux.git synced 2024-09-19 18:45:48 +08:00
cmux.go:28:1: exported method ErrNotMatched.Temporary should have comment or be unexported
cmux.go:29:1: exported method ErrNotMatched.Timeout should have comment or be unexported
cmux.go:38:2: exported var ErrListenerClosed should have comment or be unexported
cmux.go:165:6: exported type MuxConn should have comment or be unexported
This commit is contained in:
Tamir Duberstein 2016-01-07 10:08:59 -05:00 committed by Soheil Hassas Yeganeh
parent 05566d752e
commit 48deeb47a3
2 changed files with 15 additions and 1 deletions

View File

@ -3,3 +3,9 @@ language: go
go:
- 1.3
- 1.4
before_install:
- go get -u github.com/golang/lint/golint
before_script:
- golint ./...

10
cmux.go
View File

@ -13,6 +13,8 @@ type Matcher func(r io.Reader) (ok bool)
// the mux should continue serving the listener.
type ErrorHandler func(err error) (ok bool)
var _ net.Error = ErrNotMatched{}
// ErrNotMatched is returned whenever a connection is not matched by any of
// the matchers registered in the multiplexer.
type ErrNotMatched struct {
@ -24,8 +26,11 @@ func (e ErrNotMatched) Error() string {
e.c.RemoteAddr())
}
// Temporary implements the net.Error interface.
func (e ErrNotMatched) Temporary() bool { return true }
func (e ErrNotMatched) Timeout() bool { return false }
// Timeout implements the net.Error interface.
func (e ErrNotMatched) Timeout() bool { return false }
type errListenerClosed string
@ -34,6 +39,8 @@ func (e errListenerClosed) Temporary() bool { return false }
func (e errListenerClosed) Timeout() bool { return false }
var (
// ErrListenerClosed is returned from muxListener.Accept when the underlying
// listener is closed.
ErrListenerClosed = errListenerClosed("mux: listener closed")
)
@ -157,6 +164,7 @@ func (l muxListener) Accept() (c net.Conn, err error) {
}
}
// MuxConn wraps a net.Conn and provides transparent sniffing of connection data.
type MuxConn struct {
net.Conn
buf buffer