rest

package
v0.1.48 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

middleware aop

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpServer

func NewHttpServer(opts ...HttpServerOption) *httpServer

Types

type Context

type Context struct {
	Req    *http.Request
	Resp   http.ResponseWriter
	Params map[string]string

	RespData       []byte
	RespStatusCode int

	MatchedRoute string
}

type HandleFunc

type HandleFunc func(ctx *Context)

type HttpServerOption added in v0.1.21

type HttpServerOption func(s *httpServer)

func ServerWithMiddleware added in v0.1.21

func ServerWithMiddleware(ms ...MiddleWare) HttpServerOption

type MiddleWare added in v0.1.21

type MiddleWare func(next HandleFunc) HandleFunc

type Server

type Server interface {
	http.Handler
	Start(addr string) error
	// contains filtered or unexported methods
}

Directories

Path Synopsis
middleware

Jump to

Keyboard shortcuts

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