Library
Module
Module type
Parameter
Class
Class type
Extism manifest
This package provides an OCaml interface for the Extism manifest
Create a manifest from a file on disk:
Manifest.create [ Manifest.Wasm.file myPath ]
Or from a URL:
Manifest.create [ Manifest.Wasm.url myUrl ]
Create a manifest from a file on disk with a timeout of 1s
set and memory.max_pages
set to 100:
Manifest.create ~timeout_ms:1000 [ Manifest.Wasm.file ]
|> Manifest.with_memory_max 100
type memory_options = {
max_pages : int option;
max_pages
can be used to limit the total number of pages used by the runtime
max_http_response_bytes : int option;
max_http_response_bytes
can be used to limit the size of the response returned by extism_http_request
}
Memory options
val yojson_of_memory_options :
memory_options ->
Ppx_yojson_conv_lib.Yojson.Safe.t
val memory_options_of_yojson :
Ppx_yojson_conv_lib.Yojson.Safe.t ->
memory_options
val yojson_of_dict : dict -> Ppx_yojson_conv_lib.Yojson.Safe.t
val dict_of_yojson : Ppx_yojson_conv_lib.Yojson.Safe.t -> dict
Key/value dictionary with optional values, used for passing values into a plugin at runtime
val yojson_of_config : config -> Ppx_yojson_conv_lib.Yojson.Safe.t
val config_of_yojson : Ppx_yojson_conv_lib.Yojson.Safe.t -> config
module Wasm : sig ... end
type t = {
wasm : Wasm.t list;
A list of Wasm modules to be linked, the final module or the module named main
will be used as the main module
memory : memory_options option;
Memory options
*)config : config option;
Config contains immutable configutation parameters from the host to a plugin
*)allowed_hosts : string list option;
A list of allowed hosts when using Extism HTTP functions
*)allowed_paths : dict option;
A dict containing a mapping from local_path:guest_path
timeout_ms : int option;
Plugin timeout in milliseconds
*)}
Manifest type
val create :
?config:config ->
?memory:memory_options ->
?allowed_hosts:string list ->
?allowed_paths:dict ->
?timeout_ms:int ->
Wasm.t list ->
t
Create new t
val to_json : t -> string
Convert manifest to JSON
val of_json : string -> t
Read manifest from JSON string
val of_file : string -> t
Read manifest from JSON file