Versions in this module Expand all Collapse all v1 v1.0.1 Sep 5, 2023 Changes in this version + const SALT + var CIPHER_TYPE_MAP = map[string]CipherConfig + var ErrConnectionReset = fmt.Errorf("connection reset") + var ErrConnectionWriteTimeout = fmt.Errorf("connection write timeout") + var ErrDuplicateStream = fmt.Errorf("duplicate stream initiated") + var ErrInvalidMsgType = fmt.Errorf("invalid msg type") + var ErrInvalidVersion = fmt.Errorf("invalid protocol version") + var ErrKeepAliveTimeout = fmt.Errorf("keepalive timeout") + var ErrRecvWindowExceeded = fmt.Errorf("recv window exceeded") + var ErrRemoteGoAway = fmt.Errorf("remote end is not accepting connections") + var ErrSessionShutdown = fmt.Errorf("session shutdown") + var ErrStreamClosed = fmt.Errorf("stream closed") + var ErrStreamsExhausted = fmt.Errorf("streams exhausted") + var ErrTimeout = fmt.Errorf("i/o deadline reached") + var ErrUnexpectedFlag = fmt.Errorf("unexpected flag") + var UnkonwnCipherTypeErr = errors.New("Unknown cipher type") + func VerifyConfig(config *Config) error + type Cipher struct + func NewBlockCipher(cipherType string, pass []byte) (*Cipher, error) + func (c *Cipher) Decrypt(data []byte) ([]byte, error) + func (c *Cipher) Encrypt(data []byte) []byte + func (c *Cipher) Overhead() int + type CipherConfig struct + KeySize int + type Config struct + AcceptBacklog int + CipherType string + ConnectionWriteTimeout time.Duration + EnableKeepAlive bool + KeepAliveInterval time.Duration + LogOutput io.Writer + MaxStreamWindowSize uint32 + Password string + func DefaultConfig() *Config + type Pool struct + func NewPool(addr string, config *Config, size int) (*Pool, error) + func (p *Pool) Close() + func (p *Pool) Open() (*Stream, error) + func (p *Pool) OpenStream() (*Stream, error) + func (p *Pool) Size() int + func (p *Pool) TakeSession() (*Session, error) + type Session struct + func Client(conn io.ReadWriteCloser, config *Config) (*Session, error) + func Server(conn io.ReadWriteCloser, config *Config) (*Session, error) + func (s *Session) Accept() (net.Conn, error) + func (s *Session) AcceptStream() (*Stream, error) + func (s *Session) Addr() net.Addr + func (s *Session) Close() error + func (s *Session) GoAway() error + func (s *Session) IsClosed() bool + func (s *Session) LocalAddr() net.Addr + func (s *Session) NumStreams() int + func (s *Session) Open() (net.Conn, error) + func (s *Session) OpenStream() (*Stream, error) + func (s *Session) Ping() (time.Duration, error) + func (s *Session) RemoteAddr() net.Addr + func (s *Session) StreamIDExhausted() bool + type Stream struct + func (s *Stream) Close() error + func (s *Stream) LocalAddr() net.Addr + func (s *Stream) Read(b []byte) (n int, err error) + func (s *Stream) RemoteAddr() net.Addr + func (s *Stream) Session() *Session + func (s *Stream) SetDeadline(t time.Time) error + func (s *Stream) SetReadDeadline(t time.Time) error + func (s *Stream) SetWriteDeadline(t time.Time) error + func (s *Stream) Shrink() + func (s *Stream) StreamID() uint32 + func (s *Stream) Write(b []byte) (n int, err error)