websocketutil

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 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(url string) (*websocket.Conn, error)
	CloseConnection(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