Documentation ¶
Overview ¶
Package handlers : this one is to start a new Capsule HTTP process
Package handlers : this one is to start a new Capsule HTTP process
Package handlers : this one is to start a new Capsule HTTP process
Package handlers : this one is to start a new Capsule HTTP process
Package handlers : this one is to start a new Capsule HTTP process
Package handlers : this one is to start a new Capsule HTTP process
Package handlers : this one is to start a new Capsule HTTP process
Index ¶
- func CallExternalFunction(c *fiber.Ctx) error
- func CallExternalFunctionHealthCheck(c *fiber.Ctx) error
- func CallExternalIndexPageFunction(c *fiber.Ctx) error
- func CallWasmFunction(c *fiber.Ctx) error
- func CallWasmFunctionHealthCheck(c *fiber.Ctx) error
- func CallWasmFunctionMetrics(c *fiber.Ctx) error
- func DuplicateExternalFunction(c *fiber.Ctx) error
- func GetLastCall() time.Time
- func GetListOfCapsuleHTTPProcesses(c *fiber.Ctx) error
- func GetMainCapsuleTaskPath() string
- func GetModule(ctx context.Context, wasmFile []byte) (api.Module, error)
- func NotifiedMainCapsuleHTTPProcess(c *fiber.Ctx) error
- func ReStartCapsuleHTTPProcess(c *fiber.Ctx) error
- func SetLastCall(t time.Time)
- func SetMainCapsuleTaskPath(path string)
- func StartNewCapsuleHTTPProcess(c *fiber.Ctx) error
- func StopAndKillCapsuleHTTPProcess(c *fiber.Ctx) error
- func StoreContext(capsuleContext context.Context)
- func StoreRuntime(capsuleRuntime wazero.Runtime)
- func StoreWasmFile(loadedWasmFile []byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallExternalFunction ¶
func CallExternalFunction(c *fiber.Ctx) error
CallExternalFunction calls the WASM module of another Capsule HTTP process ! this a work in progress c *fiber.Ctx: a pointer to a fiber context object that contains information about the http request. error: returns an error if the external function call fails.
func CallExternalFunctionHealthCheck ¶
func CallExternalFunctionHealthCheck(c *fiber.Ctx) error
CallExternalFunctionHealthCheck is called by the main process of the faas mode
Routes:
app.All("/functions/health/:function_name", handlers.CallExternalFunctionHealthCheck) app.All("/functions/health/:function_name/:function_revision", handlers.CallExternalFunctionHealthCheck) app.All("/functions/health/:function_name/:function_revision/:function_index", handlers.CallExternalFunctionHealthCheck)
func CallExternalIndexPageFunction ¶
func CallExternalIndexPageFunction(c *fiber.Ctx) error
CallExternalIndexPageFunction is called by the main process of the faas mode to call the index.page.wasm the function name is "index.page" only GET method is supported
func CallWasmFunction ¶
func CallWasmFunction(c *fiber.Ctx) error
CallWasmFunction is a function that handles the execution of a WebAssembly function.
c is a pointer to a Fiber context. error is the error returned by the function.
func CallWasmFunctionHealthCheck ¶
func CallWasmFunctionHealthCheck(c *fiber.Ctx) error
CallWasmFunctionHealthCheck is a function that handles the execution of a WebAssembly function. Route: app.All("/health", handlers.CallWasmFunctionHealthCheck)
func CallWasmFunctionMetrics ¶
func CallWasmFunctionMetrics(c *fiber.Ctx) error
CallWasmFunctionMetrics is a function that handles the execution of a WebAssembly function. Route: app.All("/metrics", handlers.CallWasmFunctionMetrics)
func DuplicateExternalFunction ¶
func DuplicateExternalFunction(c *fiber.Ctx) error
DuplicateExternalFunction duplicates a given function and returns its new function name.
c: a fiber context that contains information about the request. Returns an error in case of an error.
! this a work in progress The handler duplicate an existing function record with a different revision name !With the same process (it's a pointer to the same process).
func GetLastCall ¶
GetLastCall returns the time of the last call.
This function does not take any parameters. It returns a time.Time object.
func GetListOfCapsuleHTTPProcesses ¶
func GetListOfCapsuleHTTPProcesses(c *fiber.Ctx) error
GetListOfCapsuleHTTPProcesses retrieves the list of external Capsule processes and sends it as a JSON response.
c *fiber.Ctx: A pointer to the fiber context. error: An error indicating if there was a problem with the retrieval of the data. error: An error indicating if there was a problem with sending the JSON response.
func GetMainCapsuleTaskPath ¶
func GetMainCapsuleTaskPath() string
GetMainCapsuleTaskPath returns the path where the main Capsule HTTP process is installed
func NotifiedMainCapsuleHTTPProcess ¶
func NotifiedMainCapsuleHTTPProcess(c *fiber.Ctx) error
NotifiedMainCapsuleHTTPProcess is triggered when a Capsule HTTP child process notifies the parent process (main Capsule HTTP process)
func ReStartCapsuleHTTPProcess ¶
func ReStartCapsuleHTTPProcess(c *fiber.Ctx) error
ReStartCapsuleHTTPProcess restarts an existing stopped process Called by CallExternalFunction
func SetMainCapsuleTaskPath ¶
func SetMainCapsuleTaskPath(path string)
SetMainCapsuleTaskPath sets the path where the main Capsule HTTP process is installed
func StartNewCapsuleHTTPProcess ¶
func StartNewCapsuleHTTPProcess(c *fiber.Ctx) error
StartNewCapsuleHTTPProcess is a Go function that handles HTTP requests for starting a capsule. ! this a work in progress It takes in a pointer to a fiber.Ctx object. It returns an error object.
func StopAndKillCapsuleHTTPProcess ¶
func StopAndKillCapsuleHTTPProcess(c *fiber.Ctx) error
StopAndKillCapsuleHTTPProcess stops the HTTP process for the given Fiber context.
c: a pointer to a fiber.Ctx object representing the context of the HTTP request. error: an error object that indicates whether an error occurred during the function execution.
func StoreContext ¶
StoreContext stores the given context for later use.
capsuleContext: the context to be stored.
func StoreRuntime ¶
StoreRuntime stores the given capsule runtime.
capsuleRuntime: a wazero.Runtime object representing the runtime to be stored.
func StoreWasmFile ¶
func StoreWasmFile(loadedWasmFile []byte)
StoreWasmFile stores the given byte slice of a loaded WebAssembly file.
loadedWasmFile is a byte slice containing the contents of the loaded WebAssembly file.
Types ¶
This section is empty.