Genie.Renderer.WebRenderable
— Typemutable struct WebRenderable
Represents an object that can be rendered on the web as a HTTP Response
Missing docstring for render
. Check Documenter's build log for details.
Genie.Renderer.redirect
— FunctionSets redirect headers and prepares the Response
. It accepts 3 parameters: 1 - Label of a Route (to learn more, see the advanced routes section) 2 - Default HTTP 302 Found Status: indicates that the provided resource will be changed to a URL provided 3 - Tuples (key, value) to define the HTTP request header
Example: julia> Genie.Renderer.redirect(:index, 302, Dict("Content-Type" => "application/json; charset=UTF-8"))
HTTP.Messages.Response: HTTP/1.1 302 Moved Temporarily Content-Type: application/json; charset=UTF-8 Location: /index
Redirecting you to /index
Genie.Renderer.hasrequested
— Functionhasrequested(content_type::Symbol) :: Bool
Checks wheter or not the requested content type matches content_type
.
Genie.Renderer.respond
— FunctionConstructs a Response
corresponding to the Content-Type of the request.
Genie.Renderer.registervars
— Functionregistervars(vs...) :: Nothing
Loads the rendering vars into the task's scope
Missing docstring for injectvars
. Check Documenter's build log for details.
Genie.Renderer.view_file_info
— Functionview_file_info(path::String, supported_extensions::Vector{String}) :: Tuple{String,String}
Extracts path and extension info about a file
Genie.Renderer.vars_signature
— Functionvars_signature() :: String
Collects the names of the view vars in order to create a unique hash/salt to identify compiled views with different vars.
Genie.Renderer.function_name
— Functionfunction_name(file_path::String)
Generates function name for generated HTML+Julia views.
Genie.Renderer.m_name
— Functionm_name(file_path::String)
Generates module name for generated HTML+Julia views.
Genie.Renderer.build_is_stale
— Functionbuild_is_stale(file_path::String, build_path::String) :: Bool
Checks if the view template has been changed since the last time the template was compiled.
Genie.Renderer.build_module
— Functionbuild_module(content::String, path::String, mod_name::String) :: String
Persists compiled Julia view data to file and returns the path
Genie.Renderer.preparebuilds
— Functionpreparebuilds() :: Bool
Sets up the build folder and the build module file for generating the compiled views.
Genie.Renderer.purgebuilds
— Functionpurgebuilds(subfolder = BUILD_NAME) :: Bool
Removes the views builds folders with all the generated views.
Genie.Renderer.changebuilds
— Functionchangebuilds(subfolder = BUILD_NAME) :: Bool
Changes/creates a new builds folder.
Genie.Renderer.set_negotiated_content
— Functionset_negotiated_content(req::HTTP.Request, res::HTTP.Response, params::Dict{Symbol,Any})
Configures the request, response, and params response content type based on the request and defaults.
Genie.Renderer.negotiate_content
— Functionnegotiate_content(req::Request, res::Response, params::Params) :: Response
Computes the content-type of the Response
, based on the information in the Request
.