websocket

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sink

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

Sink implements a simple WebSocket sink. It dials out to a ws/wss URL and writes one text frame per message. The frame payload is produced by the configured Formatter (defaults to JSON when wired by factory). Optional application-level ACK can be enabled via RequireAck.

func New

func New(url string, headers map[string]string, subprotocols []string, connectTimeout, writeTimeout, heartbeatInterval time.Duration, requireAck bool, fmttr hermod.Formatter) *Sink

New creates a new WebSocket sink.

func (*Sink) Close

func (s *Sink) Close() error

func (*Sink) Ping

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

func (*Sink) SetTLSConfig

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

SetTLSConfig allows configuring TLS options and optional cert pinning.

func (*Sink) Write

func (s *Sink) Write(ctx context.Context, msg hermod.Message) error

Jump to

Keyboard shortcuts

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