modHttp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoResponseSendError = errors.New("no response send")

Functions

func InstallModule

func InstallModule()

func JsConfigureServer

func JsConfigureServer(serverPort int, params libHttpServer.HttpServerStartParams) bool

JsConfigureServer configure a server designed by his port. It does nothing if the server is already started, but returns false if the configuration can't be applied.

func JsGetHost

func JsGetHost(serverPort int, hostName string) *progpAPI.SharedResource

JsGetHost returns an HttpHost object from a port and a hostname.

func JsRequestCookie

func JsRequestCookie(resHttpRequest *progpAPI.SharedResource, cookieName string) (error, map[string]any)

func JsRequestCookies

func JsRequestCookies(resHttpRequest *progpAPI.SharedResource) (error, map[string]map[string]any)

func JsRequestHeaders

func JsRequestHeaders(resHttpRequest *progpAPI.SharedResource) (error, map[string]string)

func JsRequestHost

func JsRequestHost(resHttpRequest *progpAPI.SharedResource) (error, string)

func JsRequestIP

func JsRequestIP(resHttpRequest *progpAPI.SharedResource) (error, string)

func JsRequestMethod

func JsRequestMethod(resHttpRequest *progpAPI.SharedResource) (error, string)

func JsRequestPath

func JsRequestPath(resHttpRequest *progpAPI.SharedResource) (error, string)

func JsRequestPostArgs

func JsRequestPostArgs(resHttpRequest *progpAPI.SharedResource) (error, map[string]any)

func JsRequestQueryArgs

func JsRequestQueryArgs(resHttpRequest *progpAPI.SharedResource) (error, map[string]string)

func JsRequestReadFormFileAsync

func JsRequestReadFormFileAsync(resHttpRequest *progpAPI.SharedResource, fieldName string, fileOffset int, callback progpAPI.ScriptFunction)

func JsRequestRemainingSegments

func JsRequestRemainingSegments(resHttpRequest *progpAPI.SharedResource) (error, []string)

func JsRequestSaveFormFileAsync

func JsRequestSaveFormFileAsync(resHttpRequest *progpAPI.SharedResource, fieldName string, fileOffset int, saveFilePath string, callback progpAPI.ScriptFunction)

func JsRequestSetCookie

func JsRequestSetCookie(resHttpRequest *progpAPI.SharedResource, key string, value string, options libHttpServer.HttpCookieOptions) error

func JsRequestSetHeader

func JsRequestSetHeader(resHttpRequest *progpAPI.SharedResource, key string, value string) error

func JsRequestURI

func JsRequestURI(resHttpRequest *progpAPI.SharedResource) (error, string)

func JsRequestWildcards

func JsRequestWildcards(resHttpRequest *progpAPI.SharedResource) (error, []string)

func JsReturnString

func JsReturnString(resHttpRequest *progpAPI.SharedResource, responseCode int, contentType string, responseText string) error

JsReturnString set the response to returns.

func JsStartServer

func JsStartServer(serverPort int) error

JsStartServer starts the server designed by his port. This server must have been configured before, otherwise it uses the default configuration.

func JsVerbWithFunction

func JsVerbWithFunction(resHost *progpAPI.SharedResource, verb string, requestPath string, callback progpAPI.ScriptFunction) error

JsVerbWithFunction bind a GET/POST/... call to a function inside a context. This function is executed when the GET request match.

Types

This section is empty.

Jump to

Keyboard shortcuts

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