forked from keploy/keploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
executable file
·51 lines (45 loc) · 1.45 KB
/
main.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
package main
import (
"fmt"
_ "net/http/pprof"
"time"
"github.com/cloudflare/cfssl/log"
sentry "github.com/getsentry/sentry-go"
"go.keploy.io/server/cmd"
"go.keploy.io/server/utils"
)
// version is the version of the server and will be injected during build by ldflags
// see https://goreleaser.com/customization/build/
var version string
var dsn string
const logo string = `
▓██▓▄
▓▓▓▓██▓█▓▄
████████▓▒
▀▓▓███▄ ▄▄ ▄ ▌
▄▌▌▓▓████▄ ██ ▓█▀ ▄▌▀▄ ▓▓▌▄ ▓█ ▄▌▓▓▌▄ ▌▌ ▓
▓█████████▌▓▓ ██▓█▄ ▓█▄▓▓ ▐█▌ ██ ▓█ █▌ ██ █▌ █▓
▓▓▓▓▀▀▀▀▓▓▓▓▓▓▌ ██ █▓ ▓▌▄▄ ▐█▓▄▓█▀ █▓█ ▀█▄▄█▀ █▓█
▓▌ ▐█▌ █▌
▓
`
func main() {
if version == "" {
version = "2-dev"
}
utils.Version = version
fmt.Println(logo, " ")
fmt.Printf("version: %v\n\n", version)
//Initialise sentry.
err := sentry.Init(sentry.ClientOptions{
Dsn: dsn,
TracesSampleRate: 1.0,
})
log.Level = 0
if err != nil {
log.Debug("Could not initialise sentry.", err)
}
defer utils.HandlePanic()
defer sentry.Flush(2 * time.Second)
cmd.Execute()
}