Versions in this module Expand all Collapse all v0 v0.1.0 Oct 1, 2017 Changes in this version + func Dispose(v interface{}) + type Config struct + DialTimeout time.Duration + FrameSizeLimit int64 + HostnameAllowlist []string + ReadTimeout time.Duration + WriteTimeout time.Duration + type ConnectCommand struct + Headers map[string]string + Subprotocols []string + Timeout int + URL string + type ConnectResponse struct + Index int + type Connection struct + func (c *Connection) Close(frame ws.Frame) + func (c *Connection) Start() + type ConnectionTarget struct + func (c *ConnectionTarget) Close() + func (c *ConnectionTarget) Pull(header ws.Header, _ *Socket, frame *io.LimitedReader) (err error) + type Disposable interface + Dispose func() + type ErrorCode uint + const BadJSON + const DialError + const FrameTooLong + const FrameTooShort + const InvalidHostname + const InvalidURL + const UnknownConnection + const UnknownMethod + func (e ErrorCode) Error() string + func (e ErrorCode) ResponseError() *ResponseError + func (e ErrorCode) WithPath(path ...string) *ResponseError + type FragmentCollector struct + func NewFragmentCollector(header ws.Header, s *Socket) FragmentCollector + func (f *FragmentCollector) Collect(maxSize int64) (header ws.Header, r io.Reader, err error) + type MaskedReader struct + func NewMasked(r *io.LimitedReader, offset int, mask [4]byte) *MaskedReader + func (m MaskedReader) Read(p []byte) (n int, err error) + type Method struct + ID int + Method string + Params json.RawMessage + Type string + type RPC struct + func (r *RPC) Dispatch(method Method) (v interface{}, err error) + func (r *RPC) ReadMethodCall(sr io.Reader) (Method, error) + type RPCTarget struct + func NewRPCTarget(copyBuffer []byte, s *Session) *RPCTarget + func (r *RPCTarget) Close() + func (r *RPCTarget) Pull(header ws.Header, socket *Socket, frame *io.LimitedReader) (err error) + type Reply struct + Error *ResponseError + ID int + Result interface{} + Type string + type ResponseError struct + Code ErrorCode + Message string + Path string + func (r ResponseError) Error() string + type Server struct + Config *Config + func (s *Server) ServeConn(conn net.Conn) + func (s *Server) ServeHTTP(rw http.ResponseWriter, r *http.Request) + type Session struct + func (s *Session) Close() + func (s *Session) GetConnection(index int) *Connection + func (s *Session) RemoveConnection(index int) + func (s *Session) SendControlFrame(v interface{}) + func (s *Session) SendMethod(name string, params interface{}) + func (s *Session) Start() + type Socket struct + Conn net.Conn + Reader *bufio.Reader + func NewSocket(conn net.Conn, config *Config) *Socket + func (s *Socket) Close() error + func (s *Socket) CopyData(header ws.Header, r io.Reader) error + func (s *Socket) CopyIndexedData(index int, header ws.Header, r io.Reader) (err error) + func (s *Socket) ReadNextFrame() (header ws.Header, err error) + func (s *Socket) ReadNextWithBody() (header ws.Header, r io.Reader, err error) + func (s *Socket) WriteData(header ws.Header, b []byte) error + func (s *Socket) WriteFrame(frame ws.Frame) error + func (s *Socket) WriteIndexedData(index int, header ws.Header, b []byte) (err error) + type SocketClosedCommand struct + Code int + Index int + Reason string + type Target interface + Close func() + Pull func(header ws.Header, socket *Socket, frame *io.LimitedReader) (err error) + type TerminateCommand struct + Code int + Index int + Reason string + type TerminateResponse struct