transports

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: MIT Imports: 10 Imported by: 0

README

SMARTY DISCLAIMER: Subject to the terms of the associated license agreement, this software is freely available for your use. This software is FREE, AS IN PUPPIES, and is a gift. Enjoy your new responsibility. This means that while we may consider enhancement requests, we may or may not choose to entertain requests at our sole and absolute discretion.

Build Status Code Coverage Go Report Card GoDoc

Documentation

Index

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 DefaultTCPListener(address string) net.Listener

func DefaultTLSConfig

func DefaultTLSConfig() *tls.Config

func IsClosedError

func IsClosedError(err error) bool

func NetDialer

func NetDialer(options ...DialerOption) *net.Dialer

func NewChannelWriter

func NewChannelWriter(inner io.WriteCloser, capacity int) io.WriteCloser

func NewDisposeConnection

func NewDisposeConnection(inner net.Conn, cleanup func(closer io.Closer)) net.Conn

func NewDisposeListener

func NewDisposeListener(inner net.Listener) net.Listener

func NewFrameListener

func NewFrameListener(inner net.Listener) net.Listener

func NewGZipConnection

func NewGZipConnection(inner net.Conn, level int) (net.Conn, error)

func NewGZipListener

func NewGZipListener(inner net.Listener, compressionLevel int) net.Listener

func NewTCPListener

func NewTCPListener(address string) (net.Listener, error)

func NewTLSListener

func NewTLSListener(inner net.Listener, config *tls.Config) net.Listener

func NewTraceConnection

func NewTraceConnection(inner net.Conn, name string) net.Conn

func NewTraceListener

func NewTraceListener(inner net.Listener, name string) net.Listener

func TLSConfigWithPEM

func TLSConfigWithPEM(filename string) (*tls.Config, error)

Types

type ChannelWriter

type ChannelWriter struct {
	// contains filtered or unexported fields
}

func (*ChannelWriter) Close

func (this *ChannelWriter) Close() error

func (*ChannelWriter) Write

func (this *ChannelWriter) Write(buffer []byte) (int, 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)

func (*DialWriter) Write

func (this *DialWriter) Write(buffer []byte) (int, error)

type Dialer

type Dialer interface {
	Dial(string, string) (net.Conn, error)
}

func DefaultDialer

func DefaultDialer(options ...DialerOption) Dialer

func NewFrameDialer

func NewFrameDialer(inner Dialer) Dialer

func NewGZipDialer

func NewGZipDialer(inner Dialer, options ...GZipDialerOption) Dialer

func NewTLSDialer

func NewTLSDialer(dialer *net.Dialer, options ...TLSDialerOption) Dialer

func NewTraceDialer

func NewTraceDialer(inner Dialer, name string) Dialer

type DialerOption

type DialerOption func(this *net.Dialer)

func WithDialTimeout

func WithDialTimeout(timeout time.Duration) DialerOption

type DisposeConnection

type DisposeConnection struct {
	net.Conn
	// contains filtered or unexported fields
}

func (DisposeConnection) Close

func (this DisposeConnection) Close() error

type DisposeListener

type DisposeListener struct {
	net.Listener
	// contains filtered or unexported fields
}

func (*DisposeListener) Accept

func (this *DisposeListener) Accept() (net.Conn, error)

func (*DisposeListener) Close

func (this *DisposeListener) Close() error

type FrameConnection

type FrameConnection struct {
	net.Conn
}

func NewFrameConnection

func NewFrameConnection(inner net.Conn) FrameConnection

func (FrameConnection) Read

func (this FrameConnection) Read(buffer []byte) (int, error)

func (FrameConnection) ReadBody

func (this FrameConnection) ReadBody(buffer []byte) (int, error)

func (FrameConnection) ReadHeader

func (this FrameConnection) ReadHeader() (int, error)

func (FrameConnection) Write

func (this FrameConnection) Write(buffer []byte) (int, error)

type FrameDialer

type FrameDialer struct {
	Dialer
}

func (FrameDialer) Dial

func (this FrameDialer) Dial(network, address string) (net.Conn, error)

type FrameListener

type FrameListener struct {
	net.Listener
}

func (FrameListener) Accept

func (this FrameListener) Accept() (net.Conn, error)

type GZipConnection

type GZipConnection struct {
	net.Conn
	// contains filtered or unexported fields
}

func (GZipConnection) Close

func (this GZipConnection) Close() error

func (GZipConnection) Read

func (this GZipConnection) Read(buffer []byte) (int, error)

func (GZipConnection) Write

func (this GZipConnection) Write(buffer []byte) (int, error)

type GZipDialer

type GZipDialer struct {
	Dialer
	// contains filtered or unexported fields
}

func (GZipDialer) Dial

func (this GZipDialer) Dial(network, address string) (net.Conn, error)

type GZipDialerOption

type GZipDialerOption func(*GZipDialer)

func WithCompressionLevel

func WithCompressionLevel(level int) GZipDialerOption

type GZipListener

type GZipListener struct {
	net.Listener
	// contains filtered or unexported fields
}

func (GZipListener) Accept

func (this GZipListener) Accept() (net.Conn, error)

type TCPListener

type TCPListener struct {
	net.Listener
}

func (TCPListener) Accept

func (this TCPListener) Accept() (net.Conn, error)

type TLSDialer

type TLSDialer struct {
	// contains filtered or unexported fields
}

func (TLSDialer) Dial

func (this TLSDialer) Dial(network, address string) (net.Conn, error)

type TLSDialerOption

type TLSDialerOption func(*TLSDialer)

func WithTLSConfig

func WithTLSConfig(config *tls.Config) TLSDialerOption

func WithTLSServerName

func WithTLSServerName(name string) TLSDialerOption

type TraceConnection

type TraceConnection struct {
	net.Conn
	// contains filtered or unexported fields
}

func (TraceConnection) Close

func (this TraceConnection) Close() error

func (TraceConnection) Read

func (this TraceConnection) Read(buffer []byte) (int, error)

func (TraceConnection) Write

func (this TraceConnection) Write(buffer []byte) (int, error)

type TraceDialer

type TraceDialer struct {
	Dialer
	// contains filtered or unexported fields
}

func (TraceDialer) Dial

func (this TraceDialer) Dial(network, address string) (net.Conn, error)

type TraceListener

type TraceListener struct {
	net.Listener
	// contains filtered or unexported fields
}

func (TraceListener) Accept

func (this TraceListener) Accept() (net.Conn, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL