Documentation
¶
Index ¶
- func DigestAuth(ip string, port int, authURL string, method string, userName, userPwd string) (string, error)
- func DigestAuth1(ip string, port int, authURL string, body []byte, method string, ...) ([]byte, error)
- type AuthHandle
- type CallBackHandle
- type HTTPServer
- func (h *HTTPServer) AddCORS(urls ...string)
- func (h *HTTPServer) RegisterFS(virtualPath string, embedPath string, f fs.FS)
- func (h *HTTPServer) RegisterHandle(url string, callBackHandle CallBackHandle)
- func (h *HTTPServer) RegisterHandleAuth(url string, callBackHandle CallBackHandle)
- func (h *HTTPServer) RegisterVirtualPath(virtualPath, localPath string)
- func (h *HTTPServer) RegisterVirtualPathAuth(virtualPath, localPath string)
- func (h *HTTPServer) RegisterWebSocket(url string, handle websocket.Handler)
- func (h *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *HTTPServer) SetAuthHandle(authHandle AuthHandle)
- func (h *HTTPServer) StartServer(port int) error
- func (h *HTTPServer) StartServerTLS(port int, certFile string, keyFile string) error
- func (h *HTTPServer) StopServer()
- type Handle
- type HttpProxy
- func (h *HttpProxy) DeleteMessage(url string, params url.Values) ([]byte, error)
- func (h *HttpProxy) DownloadFile(remoteFilename, localFilename string) error
- func (h *HttpProxy) ForwardRequest(responseRaw *Response, requestRaw *Request) error
- func (h *HttpProxy) GetBaseUrl() string
- func (h *HttpProxy) GetMessage(url string, params url.Values) ([]byte, error)
- func (h *HttpProxy) GetMessageWidthTimeout(url string, params url.Values, timeout time.Duration) ([]byte, error)
- func (h *HttpProxy) PostMessage(requestURL string, content interface{}) ([]byte, error)
- func (h *HttpProxy) PostMessages(requestURL string, content interface{}, timeout time.Duration) ([]byte, error)
- func (h *HttpProxy) PutMessage(url string, content interface{}) ([]byte, error)
- func (h *HttpProxy) SetAuthorization(key string)
- func (h *HttpProxy) SetBaseUrl(url string)
- func (h *HttpProxy) SetHeader(key, value string)
- func (h *HttpProxy) UploadFile(url string, fileName string, datas []byte) error
- type Request
- func (r *Request) GetBodyBuffer() []byte
- func (r *Request) GetFormBool(key string) bool
- func (r *Request) GetFormInt(key string) int
- func (r *Request) GetFormIntSlice(key string) []int
- func (r *Request) GetFormJsonIntSlice(key string) ([]int, error)
- func (r *Request) GetFormString(key string) string
- func (r *Request) GetFormStringSlice(key string) []string
- func (r *Request) GetJSONValue(entity interface{}) error
- func (r *Request) GetToken() string
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DigestAuth ¶
Types ¶
type AuthHandle ¶
AuthHandle AuthHandle
type CallBackHandle ¶
CallBackHandle CallBackHandle
type HTTPServer ¶
type HTTPServer struct { AllowOrigin []string // contains filtered or unexported fields }
HTTPServer HTTPServer
func (*HTTPServer) RegisterFS ¶
func (h *HTTPServer) RegisterFS(virtualPath string, embedPath string, f fs.FS)
RegisterVirtualPath RegisterVirtualPath
func (*HTTPServer) RegisterHandle ¶
func (h *HTTPServer) RegisterHandle(url string, callBackHandle CallBackHandle)
RegisterHandle RegisterHandle
func (*HTTPServer) RegisterHandleAuth ¶
func (h *HTTPServer) RegisterHandleAuth(url string, callBackHandle CallBackHandle)
RegisterHandleAuth RegisterHandleAuth
func (*HTTPServer) RegisterVirtualPath ¶
func (h *HTTPServer) RegisterVirtualPath(virtualPath, localPath string)
RegisterVirtualPath RegisterVirtualPath
func (*HTTPServer) RegisterVirtualPathAuth ¶
func (h *HTTPServer) RegisterVirtualPathAuth(virtualPath, localPath string)
RegisterVirtualPath RegisterVirtualPath
func (*HTTPServer) RegisterWebSocket ¶
func (h *HTTPServer) RegisterWebSocket(url string, handle websocket.Handler)
RegisterWebSocket RegisterWebSocket
func (*HTTPServer) ServeHTTP ¶
func (h *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP ServeHTTP
func (*HTTPServer) SetAuthHandle ¶
func (h *HTTPServer) SetAuthHandle(authHandle AuthHandle)
func (*HTTPServer) StartServer ¶
func (h *HTTPServer) StartServer(port int) error
StartServer StartServer
func (*HTTPServer) StartServerTLS ¶
func (h *HTTPServer) StartServerTLS(port int, certFile string, keyFile string) error
StartServer StartServer
func (*HTTPServer) StopServer ¶
func (h *HTTPServer) StopServer()
type HttpProxy ¶
type HttpProxy struct {
// contains filtered or unexported fields
}
func (*HttpProxy) DeleteMessage ¶
GetMessage GetMessage
func (*HttpProxy) DownloadFile ¶
func (*HttpProxy) ForwardRequest ¶
Transport Transport
func (*HttpProxy) GetBaseUrl ¶
func (*HttpProxy) GetMessage ¶
GetMessage GetMessage
func (*HttpProxy) GetMessageWidthTimeout ¶
func (h *HttpProxy) GetMessageWidthTimeout(url string, params url.Values, timeout time.Duration) ([]byte, error)
GetMessage GetMessage
func (*HttpProxy) PostMessage ¶
PostMessage PostMessage
func (*HttpProxy) PostMessages ¶
func (h *HttpProxy) PostMessages(requestURL string, content interface{}, timeout time.Duration) ([]byte, error)
PostMessage PostMessage
func (*HttpProxy) PutMessage ¶
func (*HttpProxy) SetAuthorization ¶
func (*HttpProxy) SetBaseUrl ¶
SetBaseUrl http://localhost:80
type Request ¶
Request Request
func (*Request) GetBodyBuffer ¶
GetBodyBuffer GetBodyBuffer
func (*Request) GetFormIntSlice ¶
GetFormIntSlice GetFormIntSlice
func (*Request) GetFormJsonIntSlice ¶
GetFormIntSlice GetFormIntSlice
func (*Request) GetFormString ¶
GetFormString GetFormString
func (*Request) GetFormStringSlice ¶
GetFormStringSlice GetFormStringSlice
func (*Request) GetJSONValue ¶
GetJSONValue GetJSONValue
type Response ¶
type Response struct {
http.ResponseWriter
}
Response Response
func (*Response) ResponseResult ¶
ResponseResult ResponseResult