websocket

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Websocket

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

Websocket represents an websocket transport for the faye protocol

func (*Websocket) Connect

func (w *Websocket) Connect(msg *message.Message) error

Init is called after a client has discovered the server’s capabilities with a handshake exchange, a connection is established by sending a message to the /meta/connect channel

func (*Websocket) Disconnect

func (w *Websocket) Disconnect(m *message.Message) error

Disconnect closes all subscriptions and inform the server to remove any client-related state. any subsequent method call to the client object will result in undefined behaviour.

func (*Websocket) Handshake

func (w *Websocket) Handshake(msg *message.Message) (resp *message.Message, err error)

Handshake initiates a connection negotiation by sending a message to the /meta/handshake channel.

func (*Websocket) Init

func (w *Websocket) Init(endpoint string, options *transport.Options) error

Init initializes the transport with the provided options

func (*Websocket) Name

func (w *Websocket) Name() string

name returns the transport name (websocket)

func (*Websocket) Options

func (w *Websocket) Options() *transport.Options

Options return the transport Options

func (*Websocket) SendMessage

func (w *Websocket) SendMessage(m *message.Message) error

func (*Websocket) SetOnErrorHandler

func (w *Websocket) SetOnErrorHandler(onError func(err error))

Init initializes the transport with the provided options

func (*Websocket) SetOnMessageReceivedHandler

func (w *Websocket) SetOnMessageReceivedHandler(onMsg func(*message.Message))

func (*Websocket) SetOnTransportDownHandler

func (w *Websocket) SetOnTransportDownHandler(onTransportDown func(err error))

func (*Websocket) SetOnTransportUpHandler

func (w *Websocket) SetOnTransportUpHandler(onTransportUp func())

Jump to

Keyboard shortcuts

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