websocket

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

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