websocket

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

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

Source is a client-mode WebSocket source that dials a ws/wss URL and produces one message per received text frame. The frame is expected to be a JSON envelope with optional fields; raw payload is placed into Message.Payload.

func New

func New(url string, headers map[string]string, subprotocols []string, connectTimeout, readTimeout, heartbeatInterval, reconnectBase, reconnectMax time.Duration, maxMessageBytes int64) *Source

func (*Source) Ack

func (s *Source) Ack(ctx context.Context, msg hermod.Message) error

Ack is a no-op for client-mode WS source.

func (*Source) Close

func (s *Source) Close() error

func (*Source) Ping

func (s *Source) Ping(ctx context.Context) error

func (*Source) Read

func (s *Source) Read(ctx context.Context) (hermod.Message, error)

func (*Source) SetTLSConfig

func (s *Source) SetTLSConfig(cfg *tls.Config, pinSHA256 string)

SetTLSConfig allows providing a custom TLS configuration (custom roots, SNI, etc.).

Jump to

Keyboard shortcuts

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