Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultTCPListener(address string) net.Listener
- func DefaultTLSConfig() *tls.Config
- func IsClosedError(err error) bool
- func NetDialer(options ...DialerOption) *net.Dialer
- func NewChannelWriter(inner io.WriteCloser, capacity int) io.WriteCloser
- func NewDisposeConnection(inner net.Conn, cleanup func(closer io.Closer)) net.Conn
- func NewDisposeListener(inner net.Listener) net.Listener
- func NewFrameListener(inner net.Listener) net.Listener
- func NewGZipConnection(inner net.Conn, level int) (net.Conn, error)
- func NewGZipListener(inner net.Listener, compressionLevel int) net.Listener
- func NewTCPListener(address string) (net.Listener, error)
- func NewTLSListener(inner net.Listener, config *tls.Config) net.Listener
- func NewTraceConnection(inner net.Conn, name string) net.Conn
- func NewTraceListener(inner net.Listener, name string) net.Listener
- func TLSConfigWithPEM(filename string) (*tls.Config, error)
- type ChannelWriter
- type DialWriter
- type Dialer
- type DialerOption
- type DisposeConnection
- type DisposeListener
- type FrameConnection
- type FrameDialer
- type FrameListener
- type GZipConnection
- type GZipDialer
- type GZipDialerOption
- type GZipListener
- type TCPListener
- type TLSDialer
- type TLSDialerOption
- type TraceConnection
- type TraceDialer
- type TraceListener
Constants ¶
View Source
const ( NoCompression = flate.NoCompression BestSpeed = flate.BestSpeed BestCompression = flate.BestCompression DefaultCompression = flate.DefaultCompression )
View Source
const DefaultDialerTimeout = time.Second * 15
View Source
const MaxWriteSize = 64*1024 - 2
Variables ¶
View Source
var (
BufferTooLarge = errors.New("buffer larger than the max frame size")
)
View Source
var ErrBufferFull = errors.New("buffer full")
View Source
var ErrClosed = errors.New(closedNetworkErrorMessage)
Functions ¶
func DefaultTCPListener ¶
func DefaultTLSConfig ¶
func IsClosedError ¶
func NetDialer ¶
func NetDialer(options ...DialerOption) *net.Dialer
func NewChannelWriter ¶
func NewChannelWriter(inner io.WriteCloser, capacity int) io.WriteCloser
func NewDisposeConnection ¶
Types ¶
type ChannelWriter ¶
type ChannelWriter struct {
// contains filtered or unexported fields
}
func (*ChannelWriter) Close ¶
func (this *ChannelWriter) Close() error
type DialWriter ¶
type DialWriter struct {
// contains filtered or unexported fields
}
func NewDialWriter ¶
func NewDialWriter(dialer Dialer, address string) *DialWriter
func (*DialWriter) Close ¶
func (this *DialWriter) Close() (err error)
type Dialer ¶
func DefaultDialer ¶
func DefaultDialer(options ...DialerOption) Dialer
func NewFrameDialer ¶
func NewGZipDialer ¶
func NewGZipDialer(inner Dialer, options ...GZipDialerOption) Dialer
func NewTLSDialer ¶
func NewTLSDialer(dialer *net.Dialer, options ...TLSDialerOption) Dialer
func NewTraceDialer ¶
type DialerOption ¶
func WithDialTimeout ¶
func WithDialTimeout(timeout time.Duration) DialerOption
type DisposeConnection ¶
func (DisposeConnection) Close ¶
func (this DisposeConnection) Close() error
type DisposeListener ¶
func (*DisposeListener) Close ¶
func (this *DisposeListener) Close() error
type FrameConnection ¶
func NewFrameConnection ¶
func NewFrameConnection(inner net.Conn) FrameConnection
func (FrameConnection) ReadHeader ¶
func (this FrameConnection) ReadHeader() (int, error)
type FrameDialer ¶
type FrameDialer struct {
Dialer
}
type FrameListener ¶
type GZipConnection ¶
func (GZipConnection) Close ¶
func (this GZipConnection) Close() error
type GZipDialer ¶
type GZipDialer struct { Dialer // contains filtered or unexported fields }
type GZipDialerOption ¶
type GZipDialerOption func(*GZipDialer)
func WithCompressionLevel ¶
func WithCompressionLevel(level int) GZipDialerOption
type GZipListener ¶
type TCPListener ¶
type TLSDialerOption ¶
type TLSDialerOption func(*TLSDialer)
func WithTLSConfig ¶
func WithTLSConfig(config *tls.Config) TLSDialerOption
func WithTLSServerName ¶
func WithTLSServerName(name string) TLSDialerOption
type TraceConnection ¶
func (TraceConnection) Close ¶
func (this TraceConnection) Close() error
type TraceDialer ¶
type TraceDialer struct { Dialer // contains filtered or unexported fields }
type TraceListener ¶
Source Files ¶
- channel_writer.go
- dial_writer.go
- dialer.go
- dispose_connection.go
- dispose_listener.go
- frame_connection.go
- frame_dialer.go
- frame_listener.go
- gzip_connection.go
- gzip_dialer.go
- gzip_listener.go
- tcp_listener.go
- tls_config.go
- tls_dialer.go
- tls_listener.go
- trace_connection.go
- trace_dialer.go
- trace_listener.go
Click to show internal directories.
Click to hide internal directories.