router

package
v0.0.0-...-d2be49e Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RouteNotFoundError

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

RouteNotFoundError is an error that includes the type that did not match any route

func (RouteNotFoundError) Error

func (e RouteNotFoundError) Error() string

type Type

Type is a router from type value to a handler func

func New

func New() Type

New makes a new router

func (Type) Add

func (t Type) Add(route string, h sqsconsumer.MessageHandlerFunc)

Add registers a handler func for a specific message type

func (Type) Handler

func (t Type) Handler(ctx context.Context, msg string) error

Handler handles JSON messages and routes the message to an appropriate handler func based on the "type" property of the message

Jump to

Keyboard shortcuts

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