middleware

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(err error, msg *sockets.Message)

ErrorHandler will receive an error and the message that triggered the error.

You can inspect the error, log it etc and if you want to send the error to the sender for them to also handle, return a struct with error details. If the return is nil no message will be sent back to the sender.

func ErrorMsgHandler

func ErrorMsgHandler(errMsg sockets.ErrorMessage)

ErrorMsgHandler will receive an error and the message that triggered the error.

You can inspect the error, log it etc and if you want to send the error to the sender for them to also handle, return a struct with error details. If the return is nil no message will be sent back to the sender.

func IgnoreMyMessages

func IgnoreMyMessages(cfg *config.Socket) sockets.MiddlewareFunc

IgnoreMyMessages will drop any messages received on the socket that are sent by this client instance.

func WithAppIDPayD

func WithAppIDPayD() sockets.MiddlewareFunc

WithAppIDPayD will add 'payd' as the appID for all outgoing messages.

Types

This section is empty.

Jump to

Keyboard shortcuts

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