lmhttp

package
v0.0.0-...-325de3d Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	*gin.Context
}

func (*Context) CopyRequestHeader

func (c *Context) CopyRequestHeader(request *http.Request) map[string]string

CopyRequestHeader 复制request的header参数

func (*Context) Forward

func (c *Context) Forward(url string)

Forward 转发请求

func (*Context) ForwardWithBody

func (c *Context) ForwardWithBody(url string, body []byte)

ForwardWithBody 转发请求

func (*Context) ResponseData

func (c *Context) ResponseData(status int, data interface{})

ResponseData 返回状态和数据

func (*Context) ResponseError

func (c *Context) ResponseError(err error)

ResponseError ResponseError

func (*Context) ResponseOK

func (c *Context) ResponseOK()

ResponseOK 返回正确

func (*Context) ResponseOKWithData

func (c *Context) ResponseOKWithData(data interface{})

ResponseOKWithData 返回正确并并携带数据

type HandlerFunc

type HandlerFunc func(c *Context)

HandlerFunc HandlerFunc

type LMHttp

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

func New

func New() *LMHttp

func (*LMHttp) DELETE

func (l *LMHttp) DELETE(relativePath string, handlers ...HandlerFunc)

DELETE DELETE

func (*LMHttp) GET

func (l *LMHttp) GET(relativePath string, handlers ...HandlerFunc)

GET GET

func (*LMHttp) GetGinRoute

func (l *LMHttp) GetGinRoute() *gin.Engine

GetGinRoute GetGinRoute

func (*LMHttp) Group

func (l *LMHttp) Group(relativePath string, handlers ...HandlerFunc)

Group Group

func (*LMHttp) LMHttpHandler

func (l *LMHttp) LMHttpHandler(handlerFunc HandlerFunc) gin.HandlerFunc

LMHttpHandler LMHttpHandler

func (*LMHttp) POST

func (l *LMHttp) POST(relativePath string, handlers ...HandlerFunc)

POST POST

func (*LMHttp) Run

func (l *LMHttp) Run(addr ...string) error

Run Run

func (*LMHttp) ServeHTTP

func (l *LMHttp) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*LMHttp) Static

func (l *LMHttp) Static(relativePath string, root string)

Static Static

Jump to

Keyboard shortcuts

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