consumer

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsumer

func NewConsumer(url string) funcie.Consumer

NewConsumer creates a new Websocket consumer that consumes messages from the given URL.

func NewConsumerWithWS

func NewConsumerWithWS(wsClient WebsocketClient, url string, router utils.ClientHandlerRouter) funcie.Consumer

NewConsumerWithWS creates a new Websocket consumer that consumes messages from the given URL, with a given Websocket.

Types

type Websocket

type Websocket interface {
	Close(code ws.StatusCode, reason string) error
	Read(ctx context.Context) (ws.MessageType, []byte, error)
	Write(ctx context.Context, typ ws.MessageType, p []byte) error
}

type WebsocketClient

type WebsocketClient interface {
	Dial(ctx context.Context, u string, opts *ws.DialOptions) (Websocket, *http.Response, error)
}

type WebsocketClientWrapper

type WebsocketClientWrapper struct{}

func (*WebsocketClientWrapper) Dial

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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