Documentation ¶
Index ¶
- Variables
- func HttpBasicAuth(auth string, verify func(string, string) bool) bool
- func NewFakeConnPair(localAddr, remoteAddr net.Addr) (*FakeConn, *FakeConn)
- func StrEQ(s1, s2 string) bool
- func StrInSlice(str string, slice []string) bool
- func Transport(rw1, rw2 io.ReadWriter) error
- func VerifyByHtpasswd(users string) func(string, string) bool
- func VerifyByMap(users map[string]string) func(string, string) bool
- type FakeConn
- func (f *FakeConn) Close() error
- func (f *FakeConn) LocalAddr() net.Addr
- func (f *FakeConn) Read(b []byte) (int, error)
- func (f *FakeConn) RemoteAddr() net.Addr
- func (f *FakeConn) SetDeadline(t time.Time) error
- func (f *FakeConn) SetReadDeadline(t time.Time) error
- func (f *FakeConn) SetWriteDeadline(t time.Time) error
- func (f *FakeConn) Write(b []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SPool = sync.Pool{ New: func() interface{} { return make([]byte, 576) }, } // small buff pool LPool = sync.Pool{ New: func() interface{} { return make([]byte, 64*1024+262) }, } // large buff pool for udp )
buffer pools
Functions ¶
func HttpBasicAuth ¶ added in v0.5.0
func NewFakeConnPair ¶ added in v0.0.2
NewFakeConnPair returns a FakeConn pair
func StrInSlice ¶ added in v0.3.2
StrInSlice return whether str in slice
func VerifyByHtpasswd ¶ added in v0.5.0
VerifyByHtpasswd returns an verifier that verify by a htpasswd file
Types ¶
type FakeConn ¶ added in v0.0.2
type FakeConn struct { In *bytes.Buffer Out *bytes.Buffer // contains filtered or unexported fields }
FakeConn implements interface Conn
func NewFakeConn ¶ added in v0.0.2
NewFakeConn returns a FakeConn instance
func (*FakeConn) RemoteAddr ¶ added in v0.0.2
func (*FakeConn) SetReadDeadline ¶ added in v0.0.2
func (*FakeConn) SetWriteDeadline ¶ added in v0.0.2
Click to show internal directories.
Click to hide internal directories.