connectionutils

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(host, token string) (*websocket.Conn, error)

func ReadWSMessage

func ReadWSMessage(done chan struct{}, connection *WSConnection, messageHandler func(message []byte))

func WSHeartbeat

func WSHeartbeat(done chan struct{}, wsConnection *WSConnection)

Types

type ConnectionManager

type ConnectionManager interface {
	Save(wsConnection *WSConnection)
	Get() *WSConnection
	Close() error
}

type WSConnection

type WSConnection struct {
	Conn *websocket.Conn
	// contains filtered or unexported fields
}

func NewWebsocketConnection

func NewWebsocketConnection(configRepo repository.ConfigRepository, tokenRepo repository.TokenRepository, messageHandler func(msg []byte)) (*WSConnection, error)

Jump to

Keyboard shortcuts

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