gorouter

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 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 Endpoint

type Endpoint struct {
	Method string
	Path   string
}

type Handler

type Handler func(ctx *HttpRequestContext) HandlerCallback

type HandlerCallback

type HandlerCallback func(w http.ResponseWriter)

type HttpInstance

type HttpInstance struct {
	Handlers map[Endpoint]Handler
	Filters  []Handler
	Port     int
	// contains filtered or unexported fields
}

func NewHttpInstance

func NewHttpInstance() *HttpInstance

func (*HttpInstance) BlockingServe

func (h *HttpInstance) BlockingServe()

func (*HttpInstance) RegisterFilter

func (h *HttpInstance) RegisterFilter(handler Handler)

func (*HttpInstance) RegisterHandler

func (h *HttpInstance) RegisterHandler(method string, path string, handler Handler)

func (*HttpInstance) WithPort

func (h *HttpInstance) WithPort(port int) *HttpInstance

type HttpRequestContext

type HttpRequestContext struct {
	Request  *http.Request
	Params   httprouter.Params
	Metadata map[string]*string
}

Jump to

Keyboard shortcuts

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