websocket

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 12 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrorOfInterest

func IsErrorOfInterest(err error) bool

Types

type APIErrorResponse

type APIErrorResponse struct {
	Error   string `json:"error"`
	Details string `json:"details"`
}

type MessageHandler

type MessageHandler func(msgType int, msg []byte) error

MessageHandler is a function that processes a message received from a websocket connection.

type Reader

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

func NewReader

func NewReader(ctx context.Context, baseURL, pth, token string, handler MessageHandler) (*Reader, error)

NewReader creates a new websocket reader. The reader will pass on any message it receives to the handler function. The handler function should return an error if it fails to process the message.

func (*Reader) Done

func (w *Reader) Done() <-chan struct{}

func (*Reader) Start

func (w *Reader) Start() error

func (*Reader) Stop

func (w *Reader) Stop()

func (*Reader) WriteMessage

func (w *Reader) WriteMessage(messageType int, data []byte) error

Jump to

Keyboard shortcuts

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