-
Notifications
You must be signed in to change notification settings - Fork 0
/
cleo_config.go
88 lines (65 loc) · 1.91 KB
/
cleo_config.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package main
import "os"
import "time"
import "net/http"
import "strings"
import "runtime"
// Timeout of web client request
// Used when fetching heap information
// from go web server.
const dft = 45 * time.Second
// name of file appended to
// project.
const Utilname = "cleo_util.go"
const HeapUrl = "/debug/pprof/heap"
const ProfileUrl = "/debug/pprof/profile"
const DebugParam = "?debug=1"
const CPUTOPSamples int = 100
// Bash script used to start
// and test local go web server.
const BuildScript string = `#!/bin/bash
cmd="%s"
startServer="%s-cleo"
eval "${startServer}" &>%s.log &disown
sleep %v
eval "${cmd}" >%s.test &disown
exit 0`
// Batch script used to start
// and test local go web server.
const BatchBuildScript string = "START \"\" %s-cleo 1>%s.log\r\nping -n %v 127.0.0.1 > nul \r\n%s\\%s 1>%s.test"
// Batch script used to launch
// test to external go web server.
const BatchLaunchScript = "%s\\%s 1>%s.test"
// Bash script used to launch
// test to external go web server.
const LaunchScript = `#!/bin/bash
cmd="%s"
eval "${cmd}" >%s.test &disown
exit 0`
const HostAddress = "http://127.0.0.1"
// key used to encrypt cleo config.
// Must be AES-16 or AES-32
var Key []byte = []byte("a very very very very secret key")
// abbreviation of DeFault Directory.
// Update with the path to your go src.
// If $GOPATH is set leave as is.
var dfd string = os.ExpandEnv("$GOPATH")
var cleoWorkspace string = "cleo_workspace"
// Wait time before cleo
// begins sending test requests
var serverWaitTime int = 20
var configPath string
//default timeout of test request
//file appended to project.
// To enable pprof debug urls
var CleoUtil = []byte(`package main
import (
_ "net/http/pprof"
)`)
var tr *http.Transport = &http.Transport{
MaxIdleConns: 2,
IdleConnTimeout: dft,
ResponseHeaderTimeout: dft,
ExpectContinueTimeout: dft,
}
var isWindows bool = strings.Contains(runtime.GOOS, "indows")