websocketutil

package
v0.0.0-...-a9ed6da Latest Latest
Warning

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

Go to latest
Published: May 7, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package websocketutil contains methods for interacting with websocket connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IWebsocketUtil

type IWebsocketUtil interface {
	OpenConnection(log log.T, url string) (*websocket.Conn, error)
	CloseConnection(log log.T, ws websocket.Conn) error
}

IWebsocketUtil is the interface for the websocketutil.

type WebsocketUtil

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

WebsocketUtil struct provides functionality around creating and maintaining websockets.

func NewWebsocketUtil

func NewWebsocketUtil(logger log.T, dialerInput *websocket.Dialer) *WebsocketUtil

NewWebsocketUtil is the factory function for websocketutil.

func (*WebsocketUtil) CloseConnection

func (u *WebsocketUtil) CloseConnection(ws *websocket.Conn) error

CloseConnection closes a websocket connection given the Conn object as input.

func (*WebsocketUtil) OpenConnection

func (u *WebsocketUtil) OpenConnection(url string) (*websocket.Conn, error)

OpenConnection opens a websocket connection provided an input url.

Jump to

Keyboard shortcuts

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