websocket

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Socket

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

func Init

func Init(url string, config *config.Config) *Socket

func (*Socket) DeregisterCallback

func (s *Socket) DeregisterCallback(evType string)

func (*Socket) RegisterCallback

func (s *Socket) RegisterCallback(evType string, function func(data interface{}))

RegisterCallback registers a callback

func (*Socket) RegisterOnReconnectCallback

func (s *Socket) RegisterOnReconnectCallback(function func())

RegisterOnReconnectCallback registers a callback

func (*Socket) Request

func (s *Socket) Request(msgType string, data interface{}) (interface{}, error)

Request sends a message to the server expecting a response in a request-response pattern

func (*Socket) Send

func (s *Socket) Send(Type string, data interface{}) string

Send sends a message to server over websocket protocol

Jump to

Keyboard shortcuts

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