mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
Improve docs
This commit is contained in:
parent
ddc92c44e0
commit
8ec9ed8331
5 changed files with 6 additions and 5 deletions
|
@ -174,7 +174,7 @@ describe "ParamParser" do
|
||||||
body_params.to_s.should eq("")
|
body_params.to_s.should eq("")
|
||||||
|
|
||||||
json_params = Kemal::ParamParser.new(request).json
|
json_params = Kemal::ParamParser.new(request).json
|
||||||
json_params.should eq({} of String => AllParamTypes)
|
json_params.should eq({} of String => Nil | String | Int64 | Float64 | Bool | Hash(String, JSON::Type) | Array(JSON::Type))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ def gzip(status : Bool = false)
|
||||||
add_handler HTTP::DeflateHandler.new if status
|
add_handler HTTP::DeflateHandler.new if status
|
||||||
end
|
end
|
||||||
|
|
||||||
# nodoc:
|
# :nodoc:
|
||||||
struct UploadFile
|
struct UploadFile
|
||||||
getter field : String
|
getter field : String
|
||||||
getter data : IO::Delimited
|
getter data : IO::Delimited
|
||||||
|
|
|
@ -70,6 +70,7 @@ module Kemal::Middleware
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# :nodoc:
|
||||||
class Block
|
class Block
|
||||||
property block : HTTP::Server::Context -> String
|
property block : HTTP::Server::Context -> String
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,11 @@ module Kemal
|
||||||
# ParamParser parses the request contents including query_params and body
|
# ParamParser parses the request contents including query_params and body
|
||||||
# and converts them into a params hash which you can within the environment
|
# and converts them into a params hash which you can within the environment
|
||||||
# context.
|
# context.
|
||||||
alias AllParamTypes = Nil | String | Int64 | Float64 | Bool | Hash(String, JSON::Type) | Array(JSON::Type)
|
|
||||||
|
|
||||||
class ParamParser
|
class ParamParser
|
||||||
URL_ENCODED_FORM = "application/x-www-form-urlencoded"
|
URL_ENCODED_FORM = "application/x-www-form-urlencoded"
|
||||||
APPLICATION_JSON = "application/json"
|
APPLICATION_JSON = "application/json"
|
||||||
|
# :nodoc:
|
||||||
|
alias AllParamTypes = Nil | String | Int64 | Float64 | Bool | Hash(String, JSON::Type) | Array(JSON::Type)
|
||||||
|
|
||||||
def initialize(@request : HTTP::Request)
|
def initialize(@request : HTTP::Request)
|
||||||
@url = {} of String => String
|
@url = {} of String => String
|
||||||
|
|
|
@ -15,7 +15,7 @@ module Kemal
|
||||||
#
|
#
|
||||||
# Sessions are pruned hourly after 48 hours of inactivity.
|
# Sessions are pruned hourly after 48 hours of inactivity.
|
||||||
class Sessions
|
class Sessions
|
||||||
# Session Types are String, Integer, Float and Boolean
|
# :nodoc:
|
||||||
alias SessionTypes = String | Int32 | Float64 | Bool
|
alias SessionTypes = String | Int32 | Float64 | Bool
|
||||||
|
|
||||||
# In-memory, ephemeral datastore only.
|
# In-memory, ephemeral datastore only.
|
||||||
|
|
Loading…
Reference in a new issue