Documentation ¶
Index ¶
- Constants
- Variables
- func Endpoint(host string, port int, secure bool) string
- func EndpointFromAddr(addr string) (string, error)
- type Channel
- type Client
- type DialFunc
- type Handler
- type OptionFunc
- func WithBufferSize(size int) OptionFunc
- func WithDialFunc(dial DialFunc) OptionFunc
- func WithPingInterval(interval time.Duration) OptionFunc
- func WithPingTimeout(timeout time.Duration) OptionFunc
- func WithReceiveTimeout(timeout time.Duration) OptionFunc
- func WithSendTimeout(timeout time.Duration) OptionFunc
- type Options
- type Transport
Constants ¶
View Source
const ( OnDisconnection = gosocketio.OnDisconnection OnConnection = gosocketio.OnConnection OnError = gosocketio.OnError )
Variables ¶
Functions ¶
func EndpointFromAddr ¶
Types ¶
type Channel ¶
type Channel = gosocketio.Channel
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(endpoint string, funcs ...OptionFunc) *Client
type OptionFunc ¶
type OptionFunc func(opts *Options)
func WithBufferSize ¶
func WithBufferSize(size int) OptionFunc
WithBufferSize configures the client to use the given buffer size
func WithDialFunc ¶
func WithDialFunc(dial DialFunc) OptionFunc
WithDialFunc configures the client to use the given dial func
func WithPingInterval ¶
func WithPingInterval(interval time.Duration) OptionFunc
WithPingInterval configures the client to use the given ping interval
func WithPingTimeout ¶
func WithPingTimeout(timeout time.Duration) OptionFunc
WithPingTimeout configures the client to use the given ping timeout
func WithReceiveTimeout ¶
func WithReceiveTimeout(timeout time.Duration) OptionFunc
WithReceiveTimeout configures the client to use the given receive timeout
func WithSendTimeout ¶
func WithSendTimeout(timeout time.Duration) OptionFunc
WithSendTimeout configures the client to use the given send timeout
type Options ¶
type Options struct { PingInterval time.Duration PingTimeout time.Duration ReceiveTimeout time.Duration SendTimeout time.Duration BufferSize int DialFunc DialFunc }
func NewOptions ¶
func NewOptions(funcs ...OptionFunc) *Options
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func (*Transport) Connect ¶
func (t *Transport) Connect(url string) (conn transport.Connection, err error)
Connect implements transport.Transport.
func (*Transport) HandleConnection ¶
func (t *Transport) HandleConnection(w http.ResponseWriter, r *http.Request) (conn transport.Connection, err error)
HandleConnection implements transport.Transport.
Click to show internal directories.
Click to hide internal directories.