auth

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidInput = fmt.Errorf("invalid input")
	ErrUnauthorized = fmt.Errorf("unauthorized")
)

Functions

This section is empty.

Types

type Handler

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

Handler sends a response when a message is required to have a response, but was not handled by the next handler in the chain.

func New

func New(next, egress wrpkit.Handler, source string, partners ...string) (*Handler, error)

New creates a new instance of the Handler struct. The parameter next is the handler that will be called and monitored for errors. The parameter egress is the handler that will be called to send the response if/when the next handler fails to handle the message. The parameter source is the source to use in the response message. The list of partners is the list of allowed partners.

func (Handler) HandleWrp

func (h Handler) HandleWrp(msg wrp.Message) error

HandleWrp is called to process a message. If the message is not from an allowed partner, a response is sent to the source of the message if applicable.

Jump to

Keyboard shortcuts

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