router

package
v0.0.0-...-dc32c78 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PathValue

func PathValue(ctx context.Context, name string) string

Types

type AdvanceHandlerFunc

type AdvanceHandlerFunc func(env rollmelette.Env, metadata rollmelette.Metadata, deposit rollmelette.Deposit, payload []byte) error

type AdvanceRequest

type AdvanceRequest struct {
	Path    string          `json:"path"`
	Payload json.RawMessage `json:"payload"`
}

type InspectHandlerFunc

type InspectHandlerFunc func(env rollmelette.EnvInspector, ctx context.Context) error

type Router

type Router struct {
	AdvanceHandlers map[string]AdvanceHandlerFunc
	InspectHandlers map[string]struct {
		Handler InspectHandlerFunc
		Regex   *regexp.Regexp
	}
}

func NewRouter

func NewRouter() *Router

func (*Router) Advance

func (r *Router) Advance(env rollmelette.Env, metadata rollmelette.Metadata, deposit rollmelette.Deposit, payload []byte) error

func (*Router) HandleAdvance

func (r *Router) HandleAdvance(path string, handler AdvanceHandlerFunc)

func (*Router) HandleInspect

func (r *Router) HandleInspect(path string, handler InspectHandlerFunc)

func (*Router) Inspect

func (r *Router) Inspect(env rollmelette.EnvInspector, payload []byte) error

Jump to

Keyboard shortcuts

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