iwebsocket

package module
v0.0.0-...-b4e71a9 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 4 Imported by: 4

README

Build Status

problem statement

gorilla/websocket package exposed via interface

features

Be advised: this project is currently at Major version zero. Per the semantic versioning spec: "Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable."

Releases

for every release:

Versioning

This project adheres to the Semantic Versioning specification

Contributing

see CONTRIBUTING.md

Changelog

see CHANGELOG.md

Documentation

Overview

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Code generated by counterfeiter. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	// Close closes the underlying network connection without sending or waiting for a close frame.
	Close() error
}

Conn is implemented by websocket.Conn

type Dialer

type Dialer interface {
	// Dial creates a new client connection. Use requestHeader to specify the
	// origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies (Cookie).
	// Use the response.Header to get the selected subprotocol
	// (Sec-WebSocket-Protocol) and cookies (Set-Cookie).
	//
	// If the WebSocket handshake fails, ErrBadHandshake is returned along with a
	// non-nil *http.Response so that callers can handle redirects, authentication,
	// etcetera. The response body may not contain the entire response and does not
	// need to be closed by the application.
	Dial(urlStr string, requestHeader http.Header) (*websocket.Conn, *http.Response, error)

	// DialContext creates a new client connection. Use requestHeader to specify the
	// origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies (Cookie).
	// Use the response.Header to get the selected subprotocol
	// (Sec-WebSocket-Protocol) and cookies (Set-Cookie).
	//
	// The context will be used in the request and in the Dialer.
	//
	// If the WebSocket handshake fails, ErrBadHandshake is returned along with a
	// non-nil *http.Response so that callers can handle redirects, authentication,
	// etcetera. The response body may not contain the entire response and does not
	// need to be closed by the application.
	DialContext(ctx context.Context, urlStr string, requestHeader http.Header) (*websocket.Conn, *http.Response, error)
}

Dialer is implemented by websocket.Dialer

type FakeConn

type FakeConn struct {
	CloseStub func() error
	// contains filtered or unexported fields
}

func (*FakeConn) Close

func (fake *FakeConn) Close() error

func (*FakeConn) CloseCallCount

func (fake *FakeConn) CloseCallCount() int

func (*FakeConn) CloseCalls

func (fake *FakeConn) CloseCalls(stub func() error)

func (*FakeConn) CloseReturns

func (fake *FakeConn) CloseReturns(result1 error)

func (*FakeConn) CloseReturnsOnCall

func (fake *FakeConn) CloseReturnsOnCall(i int, result1 error)

func (*FakeConn) Invocations

func (fake *FakeConn) Invocations() map[string][][]interface{}

type FakeDialer

type FakeDialer struct {
	DialStub func(string, http.Header) (*websocket.Conn, *http.Response, error)

	DialContextStub func(context.Context, string, http.Header) (*websocket.Conn, *http.Response, error)
	// contains filtered or unexported fields
}

func (*FakeDialer) Dial

func (fake *FakeDialer) Dial(arg1 string, arg2 http.Header) (*websocket.Conn, *http.Response, error)

func (*FakeDialer) DialArgsForCall

func (fake *FakeDialer) DialArgsForCall(i int) (string, http.Header)

func (*FakeDialer) DialCallCount

func (fake *FakeDialer) DialCallCount() int

func (*FakeDialer) DialCalls

func (fake *FakeDialer) DialCalls(stub func(string, http.Header) (*websocket.Conn, *http.Response, error))

func (*FakeDialer) DialContext

func (fake *FakeDialer) DialContext(arg1 context.Context, arg2 string, arg3 http.Header) (*websocket.Conn, *http.Response, error)

func (*FakeDialer) DialContextArgsForCall

func (fake *FakeDialer) DialContextArgsForCall(i int) (context.Context, string, http.Header)

func (*FakeDialer) DialContextCallCount

func (fake *FakeDialer) DialContextCallCount() int

func (*FakeDialer) DialContextCalls

func (fake *FakeDialer) DialContextCalls(stub func(context.Context, string, http.Header) (*websocket.Conn, *http.Response, error))

func (*FakeDialer) DialContextReturns

func (fake *FakeDialer) DialContextReturns(result1 *websocket.Conn, result2 *http.Response, result3 error)

func (*FakeDialer) DialContextReturnsOnCall

func (fake *FakeDialer) DialContextReturnsOnCall(i int, result1 *websocket.Conn, result2 *http.Response, result3 error)

func (*FakeDialer) DialReturns

func (fake *FakeDialer) DialReturns(result1 *websocket.Conn, result2 *http.Response, result3 error)

func (*FakeDialer) DialReturnsOnCall

func (fake *FakeDialer) DialReturnsOnCall(i int, result1 *websocket.Conn, result2 *http.Response, result3 error)

func (*FakeDialer) Invocations

func (fake *FakeDialer) Invocations() map[string][][]interface{}

type FakeUpgrader

type FakeUpgrader struct {
	UpgradeStub func(http.ResponseWriter, *http.Request, http.Header) (*websocket.Conn, error)
	// contains filtered or unexported fields
}

func (*FakeUpgrader) Invocations

func (fake *FakeUpgrader) Invocations() map[string][][]interface{}

func (*FakeUpgrader) Upgrade

func (fake *FakeUpgrader) Upgrade(arg1 http.ResponseWriter, arg2 *http.Request, arg3 http.Header) (*websocket.Conn, error)

func (*FakeUpgrader) UpgradeArgsForCall

func (fake *FakeUpgrader) UpgradeArgsForCall(i int) (http.ResponseWriter, *http.Request, http.Header)

func (*FakeUpgrader) UpgradeCallCount

func (fake *FakeUpgrader) UpgradeCallCount() int

func (*FakeUpgrader) UpgradeCalls

func (fake *FakeUpgrader) UpgradeCalls(stub func(http.ResponseWriter, *http.Request, http.Header) (*websocket.Conn, error))

func (*FakeUpgrader) UpgradeReturns

func (fake *FakeUpgrader) UpgradeReturns(result1 *websocket.Conn, result2 error)

func (*FakeUpgrader) UpgradeReturnsOnCall

func (fake *FakeUpgrader) UpgradeReturnsOnCall(i int, result1 *websocket.Conn, result2 error)

type Upgrader

type Upgrader interface {
	// Upgrade upgrades the HTTP server connection to the WebSocket protocol.
	//
	// The responseHeader is included in the response to the client's upgrade
	// request. Use the responseHeader to specify cookies (Set-Cookie) and the
	// application negotiated subprotocol (Sec-Websocket-Protocol).
	//
	// If the upgrade fails, then Upgrade replies to the client with an HTTP error
	// response.
	Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*websocket.Conn, error)
}

Upgrader is implemented by websocket.Upgrader

Jump to

Keyboard shortcuts

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