-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconstants.go
70 lines (49 loc) · 1.89 KB
/
constants.go
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package config
import (
"time"
)
const (
Jsgo = "jsgo"
Wasm = "wasm"
Play = "play"
Frizz = "frizz"
Index = "index"
Pkg = "pkg"
Src = "src"
Git = "git"
)
const (
LocalFileserverTempDir = "~/.jsgo-local"
// ProjectId is the ID of the GCS project
ProjectID = "jsgo-192815"
// CompileHost is the domain of the compile server
CompileHost = "compile.jsgo.io"
// MaxConcurrentCompiles is the maximum number of concurrent compile jobs per server
MaxConcurrentCompiles = 2
// MaxQueue is the maximum queue length waiting for compile. After this an error is returned.
MaxQueue = 100
AssetsFilename = "assets.zip"
// WriteTimeout is the timeout when serving static files
WriteTimeout = time.Second * 2
// CompileTimeout is the timeout when compiling a package.
RequestTimeout = time.Second * 300
// PageTimeout is the timeout when generating the compile page
PageTimeout = time.Second * 5
// ServerShutdownTimeout is the timeout when doing a graceful server shutdown
ServerShutdownTimeout = time.Second * 5
// WebsocketPingPeriod is the interval between pings. Must be less than WebsocketPongTimeout.
WebsocketPingPeriod = time.Second * 10
// WebsocketPongTimeout is the time to wait for a pong from the client before cancelling
WebsocketPongTimeout = time.Second * 20
// WebsocketWriteTimeout is the write timeout for websockets
WebsocketWriteTimeout = time.Second * 20
// WebsocketInstructionTimeout is the time to wait for instructions from the client (e.g. during
// playground compile)
WebsocketInstructionTimeout = time.Second * 5
// HttpTimeout is the time to wait for HTTP operations (e.g. getting meta data - not git)
HttpTimeout = time.Second * 5
ConcurrentStorageUploads = 10
)
var ValidExtensions = []string{".go", ".jsgo.html", ".inc.js", ".md"}
var Buckets = []string{Bucket[Src], Bucket[Pkg], Bucket[Index], Bucket[Git]}
var Static = []string{Src, Pkg, Index}