OxygenInstance API
MINDFul.Server.OxygenInstance.adjustparams
— Methodadjustparams(path, func)
Adjust the order of path
and func
based on their types. This is used to support the do ... end
syntax for the routing macros.
MINDFul.Server.OxygenInstance.clearcronjobs
— FunctionClears all cron job defintions
MINDFul.Server.OxygenInstance.cleartasks
— Functioncleartasks(ct::ServerContext)
Clear any stored repeat task definitions
MINDFul.Server.OxygenInstance.dynamicfiles
— Functiondynamicfiles(folder::String, mountdir::String; headers::Vector{Pair{String,String}}=[], loadfile::Union{Function,Nothing}=nothing)
Mount all files inside the /static folder (or user defined mount point), but files are re-read on each request. The headers
array will get applied to all mounted files
MINDFul.Server.OxygenInstance.getexternalurl
— Methodgetexternalurl()
Return the external URL of the service
MINDFul.Server.OxygenInstance.getschema
— Methodgetschema()
Return the current internal schema for this app
MINDFul.Server.OxygenInstance.internalrequest
— Functioninternalrequest(req::HTTP.Request; middleware::Vector=[], serialize::Bool=true, catch_errors::Bool=true)
Directly call one of our other endpoints registered with the router, using your own middleware and bypassing any globally defined middleware
MINDFul.Server.OxygenInstance.mergeschema
— Functionmergeschema(route::String, customschema::Dict)
Merge the schema of a specific route
MINDFul.Server.OxygenInstance.resetstate
— Methodresetstate()
Reset all the internal state variables
MINDFul.Server.OxygenInstance.router
— FunctionMINDFul.Server.OxygenInstance.serve
— Functionserve(; middleware::Vector=[], handler=stream_handler, host="127.0.0.1", port=8080, async=false, parallel=false, serialize=true, catch_errors=true, docs=true, metrics=true, show_errors=true, show_banner=true, docs_path="/docs", schema_path="/schema", external_url=nothing, revise, kwargs...)
Start the webserver with your own custom request handler
MINDFul.Server.OxygenInstance.serveparallel
— Methodserveparallel(; middleware::Vector=[], handler=stream_handler, host="127.0.0.1", port=8080, serialize=true, async=false, catch_errors=true, docs=true, metrics=true, kwargs...)
MINDFul.Server.OxygenInstance.setschema
— Methodsetschema(customschema::Dict)
Overwrites the entire internal schema
MINDFul.Server.OxygenInstance.startcronjobs
— Functionstartcronjobs()
Start all the cron cronjobs within their own async task. Each individual task will loop conintually and sleep untill the next time it's suppost to
MINDFul.Server.OxygenInstance.starttasks
— Functionstarttasks()
Start all background repeat tasks
MINDFul.Server.OxygenInstance.staticfiles
— Functionstaticfiles(folder::String, mountdir::String; headers::Vector{Pair{String,String}}=[], loadfile::Union{Function,Nothing}=nothing)
Mount all files inside the /static folder (or user defined mount point). The headers
array will get applied to all mounted files
MINDFul.Server.OxygenInstance.stopcronjobs
— Functionstopcronjobs()
Stop each background task by toggling a global reference that all cron jobs reference
MINDFul.Server.OxygenInstance.stoptasks
— Functionstoptasks()
Stop all background repeat tasks
MINDFul.Server.OxygenInstance.terminate
— Functionterminate(ctx)
stops the webserver immediately
MINDFul.Server.OxygenInstance.@cron
— Macro@cron(expression::String, name::String, func::Function)
This variation provides way manually "name" a registered function. This information is used by the server on startup to log out all cron jobs.
MINDFul.Server.OxygenInstance.@cron
— Macro@cron(expression::String, func::Function)
Registers a function with a cron expression. This will extract either the function name or the random Id julia assigns to each lambda function.
MINDFul.Server.OxygenInstance.@delete
— Macro@delete(path::String, func::Function)
Used to register a function to a specific endpoint to handle DELETE requests
MINDFul.Server.OxygenInstance.@dynamicfiles
— Macro@dynamicfiles(folder::String, mountdir::String, headers::Vector{Pair{String,String}}=[])
Mount all files inside the /static folder (or user defined mount point), but files are re-read on each request
MINDFul.Server.OxygenInstance.@get
— Macro@get(path::String, func::Function)
Used to register a function to a specific endpoint to handle GET requests
MINDFul.Server.OxygenInstance.@patch
— Macro@patch(path::String, func::Function)
Used to register a function to a specific endpoint to handle PATCH requests
MINDFul.Server.OxygenInstance.@post
— Macro@post(path::String, func::Function)
Used to register a function to a specific endpoint to handle POST requests
MINDFul.Server.OxygenInstance.@put
— Macro@put(path::String, func::Function)
Used to register a function to a specific endpoint to handle PUT requests
MINDFul.Server.OxygenInstance.@repeat
— Macro@repeat(interval::Real, name::String, func::Function)
This variation provides way manually "name" a registered repeat task. This information is used by the server on startup to log out all cron jobs.
MINDFul.Server.OxygenInstance.@repeat
— Macro@repeat(interval::Real, func::Function)
Registers a repeat task. This will extract either the function name or the random Id julia assigns to each lambda function.
MINDFul.Server.OxygenInstance.@route
— Macro@route(methods::Array{String}, path::String, func::Function)
Used to register a function to a specific endpoint to handle mulitiple request types
MINDFul.Server.OxygenInstance.@staticfiles
— Macro@staticfiles(folder::String, mountdir::String, headers::Vector{Pair{String,String}}=[])
Mount all files inside the /static folder (or user defined mount point)
MINDFul.Server.OxygenInstance.@stream
— Macro@stream(path::String, func::Function)
Used to register a function to a specific endpoint to handle Streaming requests
MINDFul.Server.OxygenInstance.@websocket
— Macro@websocket(path::String, func::Function)
Used to register a function to a specific endpoint to handle WebSocket connections