ws

package
v0.0.0-...-83f64a2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*WS)

Option represents the rest client options.

func WithHeader

func WithHeader(key, val string) Option

WithHeader sets the http header for the request.

func WithLogger

func WithLogger(logger log.Logger) Option

WithLogger sets the logger for the client.

func WithRetry

func WithRetry(delay time.Duration, maxAttempts uint) Option

WithRetry retries for the error upto max attempts with the given delay between calls

func WithSerializer

func WithSerializer(s serializer.SerializerFunc) Option

WithSerializer sets the serializer for the raccoon message.

func WithUrl

func WithUrl(url string) Option

WithUrl sets the service address

type WS

type WS struct {
	raccoon.Client
	// contains filtered or unexported fields
}

Rest is the http implementation

func New

func New(options ...Option) (*WS, error)

New creates the new websocket client with provided options.

func (*WS) Close

func (ws *WS) Close()

Close closes the connection by sending a close message.

func (*WS) EventAcks

func (ws *WS) EventAcks() <-chan *raccoon.Response

func (*WS) Send

func (ws *WS) Send(events []*raccoon.Event) (string, error)

Send sends the events to the raccoon service and returns the req-guid and error if any.

Jump to

Keyboard shortcuts

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