httputils

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoGet added in v0.0.3

func DoGet(url string) bool

func PortScan

func PortScan(host, port string) bool

func RequestBody added in v0.0.3

func RequestBody(r *http.Request) string

func RequestBodyStruct added in v0.0.3

func RequestBodyStruct(r *http.Request, v interface{})

func ResponseJson added in v0.0.3

func ResponseJson(r http.ResponseWriter, code int, msg string, data interface{}, err error)

func ResponseJsonError added in v0.0.4

func ResponseJsonError(r http.ResponseWriter, code int, err error)

func ResponseJsonSuccess added in v0.0.4

func ResponseJsonSuccess(r http.ResponseWriter, code int, msg string, data interface{})

func RunServer

func RunServer(listenport int, apis []Api)

Types

type Api

type Api struct {
	Uri         string
	Handler     func(http.ResponseWriter, *http.Request)
	Description string
}

type JsonBody

type JsonBody struct {
	Code    int         `json:"code"`
	Message string      `json:"msg"`
	Data    interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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