forked from sourcegraph/sourcegraph-public-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrontend.go
35 lines (30 loc) · 1.08 KB
/
frontend.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
// Package shared contains the frontend command implementation shared
package shared
import (
"fmt"
"net/http"
"os"
"github.com/sourcegraph/sourcegraph/cmd/frontend/internal/cli"
"github.com/sourcegraph/sourcegraph/internal/env"
_ "github.com/sourcegraph/sourcegraph/cmd/frontend/registry"
)
// Main is the main function that runs the frontend process.
//
// It is exposed as function in a package so that it can be called by other
// main package implementations such as Sourcegraph Enterprise, which import
// proprietary/private code.
func Main(githubWebhook, bitbucketServerWebhook http.Handler) {
env.Lock()
err := cli.Main(githubWebhook, bitbucketServerWebhook)
if err != nil {
fmt.Fprintln(os.Stderr, "fatal:", err)
os.Exit(1)
}
}
// InitDB initializes the global frontend database connection and sets the
// version of the frontend in our versions table.
//
// It is exposed as function in a package so that it can be called by other
// main package implementations such as Sourcegraph Enterprise, which import
// proprietary/private code.
func InitDB() error { return cli.InitDB() }