router

package
v0.1.0-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MethodGet    = "GET"
	MethodPost   = "POST"
	MethodPut    = "PUT"
	MethodDelete = "DELETE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	HandleRequest(ctx context.Context, request events.LambdaFunctionURLRequest) (events.LambdaFunctionURLResponse, error)
}

Handler defines the interface for custom handlers

type Router

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

Router is the main structure for routing

func NewRouter

func NewRouter() *Router

NewRouter initializes a new Router instance

func (*Router) AddRoute

func (r *Router) AddRoute(method, path string, handler Handler)

AddRoute registers a new route with a handler

func (*Router) HandleRequest

HandleRequest routes the incoming request to the appropriate handler

Jump to

Keyboard shortcuts

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