websocket

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWSStream

func NewWSStream(conn connection, ctx context.Context, info host2.StreamInfo) *stream

func StartTracker added in v0.4.1

func StartTracker(f func()) chan struct{}

Types

type Metrics

type Metrics struct {
	OpenedSubConns   metrics.Counter
	ClosedSubConns   metrics.Counter
	OpenedWebsockets metrics.Counter
	ActiveSubConns   metrics.Gauge
}

type MultiplexedMessage

type MultiplexedMessage struct {
	ID  SubConnId `json:"id"`
	Msg []byte    `json:"msg"`
	Err string    `json:"err"`
}

type MultiplexedProvider

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

func NewMultiplexedProvider

func NewMultiplexedProvider(tracerProvider tracing.Provider, metricsProvider metrics.Provider) *MultiplexedProvider

func (*MultiplexedProvider) KillAll added in v0.4.1

func (c *MultiplexedProvider) KillAll() error

func (*MultiplexedProvider) NewClientStream

func (c *MultiplexedProvider) NewClientStream(info host2.StreamInfo, ctx context.Context, src host2.PeerID, config *tls.Config) (s host2.P2PStream, err error)

func (*MultiplexedProvider) NewServerStream

func (c *MultiplexedProvider) NewServerStream(writer http.ResponseWriter, request *http.Request, newStreamCallback func(host2.P2PStream)) error

type SimpleProvider

type SimpleProvider struct{}

func NewSimpleProvider

func NewSimpleProvider() *SimpleProvider

func (*SimpleProvider) NewClientStream

func (p *SimpleProvider) NewClientStream(info host2.StreamInfo, ctx context.Context, src host2.PeerID, config *tls.Config) (host2.P2PStream, error)

func (*SimpleProvider) NewServerStream

func (p *SimpleProvider) NewServerStream(writer http.ResponseWriter, request *http.Request, newStreamCallback func(host2.P2PStream)) error

type StreamMeta

type StreamMeta struct {
	SessionID   string       `json:"session_id"`
	ContextID   string       `json:"context_id"`
	PeerID      host2.PeerID `json:"peer_id"`
	SpanContext []byte       `json:"span_context"`
}

StreamMeta is the first message sent from the websocket client to transmit metadata information

type SubConnId

type SubConnId = string

Jump to

Keyboard shortcuts

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