websocketutil

package
v0.0.0-...-955c50f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

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, requestHeader http.Header) (*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, appConfig appconfig.SsmagentConfig, 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, requestHeader http.Header) (*websocket.Conn, error)

OpenConnection opens a websocket connection provided an input url and request header.

Jump to

Keyboard shortcuts

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