lib

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPServer

func NewHTTPServer(routers []Router, options options.Options) *server

func ServeRequest

func ServeRequest(req InboundRequest)

ServeRequest handles an inbound request.

Types

type InboundRequest

type InboundRequest struct {
	// W is the writer to write the response to
	W http.ResponseWriter
	// R is the reader to read the request from
	R *http.Request
	// EndpointLogic is the logic to handle the request
	EndpointLogic func() (interface{}, error)
	// ReqBody is the object where when applicable body of request has to be
	// unmarshalled
	ReqBody interface{}
	// StatusCode is the status code to return
	StatusCode int
}

InboundRequest is a struct that represents an inbound request

type Router

type Router interface {
	Register(httpRouter chi.Router)
}

Router is an interface which all rest Router must implement.

Jump to

Keyboard shortcuts

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