socket

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Url        string
	HttpClient *http.Client

	// messageFunc gets executed on each received message from the socket
	MessageFunc func(bytes []byte)
	// reconnectFunc gets called when successfully reconnected to the socket
	ReconnectFunc func()
	// debugFunc gets called on every connection event
	DebugFunc func(string)
}

type Socket

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

func NewSocket

func NewSocket(
	ctx context.Context,
	options *Options,
) (*Socket, error)

func (*Socket) SendJSON

func (w *Socket) SendJSON(ctx context.Context, msg any) error

Jump to

Keyboard shortcuts

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