ws

package
v0.2.0-alpha.13 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

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

Overview

Package ws implements the WebSocket connector.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	MsgType int
	Payload []byte
}

Message represents a WebSocket message container. Message types are defined in RFC 6455, section 11.8.

type WebSocketSink

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

WebSocketSink represents a WebSocket sink connector.

func NewWebSocketSink

func NewWebSocketSink(ctx context.Context, url string) (*WebSocketSink, error)

NewWebSocketSink creates and returns a new WebSocketSink using the default dialer.

func NewWebSocketSinkWithDialer

func NewWebSocketSinkWithDialer(ctx context.Context, url string, dialer *websocket.Dialer) (*WebSocketSink, error)

NewWebSocketSinkWithDialer returns a new WebSocketSink instance.

func (*WebSocketSink) In

func (wsock *WebSocketSink) In() chan<- any

In returns an input channel for receiving data.

type WebSocketSource

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

WebSocketSource represents a WebSocket source connector.

func NewWebSocketSource

func NewWebSocketSource(ctx context.Context, url string) (*WebSocketSource, error)

NewWebSocketSource creates and returns a new WebSocketSource using the default dialer.

func NewWebSocketSourceWithDialer

func NewWebSocketSourceWithDialer(ctx context.Context, url string, dialer *websocket.Dialer) (*WebSocketSource, error)

NewWebSocketSourceWithDialer returns a new WebSocketSource instance.

func (*WebSocketSource) Out

func (wsock *WebSocketSource) Out() <-chan any

Out returns an output channel for sending data.

func (*WebSocketSource) Via

func (wsock *WebSocketSource) Via(_flow streams.Flow) streams.Flow

Via streams data through the given flow.

Jump to

Keyboard shortcuts

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