wrpkit

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotHandled = errors.New("message not handled")
)

Functions

This section is empty.

Types

type Handler

type Handler interface {
	// HandleWrp is called whenever a message is received that matches the
	// criteria associated with the handler.
	//
	// Unless the error of ErrNotHandled is returned, the handler is
	// considered to have consumed the message.  It is up to the handler to
	// perform any responses or further actions.
	HandleWrp(wrp.Message) error
}

Handler interface is used to handle wrp messages in the system in a consistent way.

type HandlerFunc

type HandlerFunc func(wrp.Message) error

HandlerFunc is an adapter to allow the use of ordinary functions as handlers.

func (HandlerFunc) HandleWrp

func (f HandlerFunc) HandleWrp(msg wrp.Message) error

Jump to

Keyboard shortcuts

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