This MR represents a major refactor of the Go codebase, as well as introducing tests for the handlers. The MR also introduces an endpoint to shutdown or restart the Go server, which may be useful for clients who want to refresh the state of the plugin after checking out branches. Finally, this MR adds a contributing document for users who want to make feature changes.
25 lines
556 B
Go
25 lines
556 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
)
|
|
|
|
func main() {
|
|
gitInfo, err := extractGitInfo(RefreshProjectInfo, GetProjectUrlFromNativeGitCmd, GetCurrentBranchNameFromNativeGitCmd)
|
|
if err != nil {
|
|
log.Fatalf("Failure initializing plugin with `git` commands: %v", err)
|
|
}
|
|
|
|
err, client := initGitlabClient()
|
|
if err != nil {
|
|
log.Fatalf("Failed to initialize Gitlab client: %v", err)
|
|
}
|
|
|
|
err, projectInfo := initProjectSettings(client, gitInfo)
|
|
if err != nil {
|
|
log.Fatalf("Failed to initialize project settings: %v", err)
|
|
}
|
|
|
|
startServer(client, projectInfo)
|
|
}
|