forked from OxygenFramework/Oxygen.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.jl
More file actions
52 lines (41 loc) · 1.49 KB
/
Copy pathconstants.jl
File metadata and controls
52 lines (41 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module Constants
using HTTP
using RelocatableFolders
export PACKAGE_DIR, DATA_PATH,
GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, CONNECT, TRACE,
HTTP_METHODS,
WEBSOCKET, STREAM,
SPECIAL_METHODS, METHOD_ALIASES, TYPE_ALIASES,
SWAGGER_VERSION, REDOC_VERSION
# Generate a reliable path to our package directory
const PACKAGE_DIR = @path @__DIR__
# Generate a reliable path to our internal data folder that works when the
# package is used with PackageCompiler.jl
const DATA_PATH = @path joinpath(@__DIR__, "..", "data")
# HTTP Methods
const GET :: String = "GET"
const POST :: String = "POST"
const PUT :: String = "PUT"
const DELETE :: String = "DELETE"
const PATCH :: String = "PATCH"
const HEAD :: String = "HEAD"
const OPTIONS :: String = "OPTIONS"
const CONNECT :: String = "CONNECT"
const TRACE :: String = "TRACE"
const HTTP_METHODS :: Set{String} = Set([GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, CONNECT, TRACE])
# Special Methods
const WEBSOCKET :: String = "WEBSOCKET"
const STREAM :: String = "STREAM"
const SPECIAL_METHODS :: Set{String} = Set([WEBSOCKET, STREAM])
# Sepcial Method Aliases
const METHOD_ALIASES :: Dict{String,String} = Dict(
WEBSOCKET => GET,
STREAM => GET
)
const TYPE_ALIASES :: Dict{String, Type} = Dict(
WEBSOCKET => HTTP.WebSockets.WebSocket,
STREAM => HTTP.Stream
)
const SWAGGER_VERSION :: String = "swagger@5.7.2"
const REDOC_VERSION :: String = "redoc@2.1.2"
end