Documentation ¶
Index ¶
- Constants
- type DefaultIDGenerator
- type FrameType
- type IDGenerator
- type Manager
- type Pauser
- type Session
- func (s *Session) Close() error
- func (s *Session) Context() interface{}
- func (s *Session) ID() string
- func (s *Session) InitSession() error
- func (s *Session) LocalAddr() net.Addr
- func (s *Session) NextReader() (FrameType, io.ReadCloser, error)
- func (s *Session) NextWriter(typ FrameType) (io.WriteCloser, error)
- func (s *Session) RemoteAddr() net.Addr
- func (s *Session) RemoteHeader() http.Header
- func (s *Session) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (s *Session) SetContext(v interface{})
- func (s *Session) Transport() string
- func (s *Session) URL() url.URL
- func (s *Session) Upgrade(transport string, conn transport.Conn)
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultIDGenerator ¶
type DefaultIDGenerator struct {
ID uint64
}
func (*DefaultIDGenerator) NewID ¶
func (g *DefaultIDGenerator) NewID() string
type IDGenerator ¶
type IDGenerator interface {
NewID() string
}
IDGenerator generates new session id. Default behavior is simple increasing number. If you need custom session id, for example using local ip as perfix, you can implement SessionIDGenerator and save in Configure. Engine.io will use custom one to generate new session id.
type Manager ¶
type Manager struct { IDGenerator // contains filtered or unexported fields }
func NewManager ¶
func NewManager(gen IDGenerator) *Manager
type Pauser ¶
type Pauser interface { Pause() Resume() }
Pauser is connection which can be paused and resumes.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) InitSession ¶
func (*Session) NextReader ¶
func (s *Session) NextReader() (FrameType, io.ReadCloser, error)
NextReader attempts to obtain a ReadCloser from the session's connection. When finished writing, the caller MUST Close the ReadCloser to unlock the connection's FramerReader.
func (*Session) NextWriter ¶
func (s *Session) NextWriter(typ FrameType) (io.WriteCloser, error)
NextWriter attempts to obtain a WriteCloser from the session's connection. When finished writing, the caller MUST Close the WriteCloser to unlock the connection's FrameWriter.
func (*Session) RemoteAddr ¶
func (*Session) RemoteHeader ¶
func (*Session) SetContext ¶
func (s *Session) SetContext(v interface{})