sockjsclient

package
v0.0.0-...-3817507 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2016 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DialOptions

type DialOptions struct {
	BaseURL                         string
	ReadBufferSize, WriteBufferSize int
	Timeout                         time.Duration
}

type Rand

type Rand struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Rand is a threaSafe rand.Rand type

type WebsocketSession

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

func ConnectWebsocketSession

func ConnectWebsocketSession(opts *DialOptions) (*WebsocketSession, error)

func NewWebsocketSession

func NewWebsocketSession(conn *websocket.Conn) *WebsocketSession

func (*WebsocketSession) Close

func (w *WebsocketSession) Close(status uint32, reason string) error

Close closes the session with provided code and reason.

func (*WebsocketSession) ID

func (w *WebsocketSession) ID() string

ID returns a session id

func (*WebsocketSession) Recv

func (w *WebsocketSession) Recv() (string, error)

Recv reads one text frame from session

func (*WebsocketSession) RemoteAddr

func (w *WebsocketSession) RemoteAddr() string

func (*WebsocketSession) Send

func (w *WebsocketSession) Send(str string) error

Send sends one text frame to session

type XHRSession

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

func NewXHRSession

func NewXHRSession(opts *DialOptions) (*XHRSession, error)

NewXHRSession returns a new XHRSession, a SockJS client which supports xhr-polling http://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html#section-74

func (*XHRSession) Close

func (x *XHRSession) Close(status uint32, reason string) error

func (*XHRSession) ID

func (x *XHRSession) ID() string

func (*XHRSession) Recv

func (x *XHRSession) Recv() (string, error)

func (*XHRSession) Send

func (x *XHRSession) Send(frame string) error

Jump to

Keyboard shortcuts

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