chi

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MPL-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindJson added in v0.0.6

func BindJson(r *http.Request, obj any) error

func GetUrlParam added in v0.0.6

func GetUrlParam(r *http.Request, key string) string

func RenderBinary added in v0.0.5

func RenderBinary(status int, data []byte) comphttp.ResponseHandler[http.ResponseWriter]

func RenderError added in v0.0.5

func RenderJson added in v0.0.5

func RenderJson(status int, obj interface{}) comphttp.ResponseHandler[http.ResponseWriter]

func RenderOKString added in v0.0.5

func RenderOKString(str string) comphttp.ResponseHandler[http.ResponseWriter]

func RenderStatus added in v0.0.5

func RenderStatus(status int) comphttp.ResponseHandler[http.ResponseWriter]

func RenderString added in v0.0.5

func RenderString(status int, raw string) comphttp.ResponseHandler[http.ResponseWriter]

Types

type ChiHttpApiServer

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

func NewChiHttpApiServer

func NewChiHttpApiServer(cfg *ChiHttpApiServerConfig) *ChiHttpApiServer

func (*ChiHttpApiServer) AddHttpApi

func (*ChiHttpApiServer) DefaultErrorHandler

func (c *ChiHttpApiServer) DefaultErrorHandler(err error) comphttp.ResponseHandler[http.ResponseWriter]

func (*ChiHttpApiServer) StartServicingOn added in v0.0.5

func (c *ChiHttpApiServer) StartServicingOn(l net.Listener) error

func (*ChiHttpApiServer) StartServing

func (c *ChiHttpApiServer) StartServing() error

type ChiHttpApiServerConfig

type ChiHttpApiServerConfig struct {
	Addr string
}

Jump to

Keyboard shortcuts

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