websocket

package
v1.18.9 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 16 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) SetResponse added in v1.17.0

func (s *Source) SetResponse(wait bool, timeout time.Duration)

SetResponse makes the source answer each frame it reads with what the workflow did with it, on the connection the frame arrived on. timeout is how long it waits for the workflow before answering "pending". Call it before the first Read.

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