rsweb

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	C_Data_Pass           = "pass"
	C_Data_Pending        = "pending"
	C_Data_Success        = "successed"
	C_Error_Denied        = "permission denied"
	C_Error_InvalidParams = "invalid request params"
)

Variables

View Source
var EnableLog = true

Functions

func HttpGetByFunc

func HttpGetByFunc(url string, fHandle func(buf []byte)) error

http.Request

func HttpPostByFunc

func HttpPostByFunc(url string, form url.Values, fHandle func(buf []byte)) error

func Init

func Init(webPath string, fs embed.FS, routerFuncList ...func(*httprouter.Router)) *httprouter.Router

func ResponseDirect

func ResponseDirect(w http.ResponseWriter, r *http.Request, data []byte, strType string)

http.Response

func ResponseError

func ResponseError(w http.ResponseWriter, r *http.Request, errorInfo string)

func ResponseOk

func ResponseOk(w http.ResponseWriter, r *http.Request, data interface{})

func ResponseOkIndent

func ResponseOkIndent(w http.ResponseWriter, r *http.Request, data interface{}, prefix, indent string)

func ResponseRedirect

func ResponseRedirect(w http.ResponseWriter, r *http.Request, url string)

func ResponseToken

func ResponseToken(w http.ResponseWriter, r *http.Request, data interface{}, token string)

func Run

func Run(ctx context.Context, port string, router *httprouter.Router, allowOrigins ...string)

func WebDecryptParams

func WebDecryptParams(r *http.Request, decryptFunc func(s string, v *url.Values)) url.Values

func WebParams

func WebParams(r *http.Request) url.Values

Types

type WebResponse

type WebResponse struct {
	Data     interface{}
	Redirect string
	Error    string
}

====================================== http =========================================

Jump to

Keyboard shortcuts

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