Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-workhorse
Commits
ceb2092f
Commit
ceb2092f
authored
Aug 23, 2015
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
We only use flags in the main function
parent
0b10eb3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
main.go
main.go
+7
-8
No files found.
main.go
View file @
ceb2092f
...
...
@@ -47,13 +47,6 @@ type gitEnv struct {
var
Version
string
// Set at build time in the Makefile
// Command-line options
var
printVersion
=
flag
.
Bool
(
"version"
,
false
,
"Print version and exit"
)
var
listenAddr
=
flag
.
String
(
"listenAddr"
,
"localhost:8181"
,
"Listen address for HTTP server"
)
var
listenNetwork
=
flag
.
String
(
"listenNetwork"
,
"tcp"
,
"Listen 'network' (protocol)"
)
var
listenUmask
=
flag
.
Int
(
"listenUmask"
,
022
,
"Umask for Unix socket, default: 022"
)
var
authBackend
=
flag
.
String
(
"authBackend"
,
"http://localhost:8080"
,
"Authentication/authorization backend"
)
// Routing table
var
gitServices
=
[
...
]
gitService
{
gitService
{
"GET"
,
"/info/refs"
,
handleGetInfoRefs
,
""
},
...
...
@@ -62,17 +55,23 @@ var gitServices = [...]gitService{
}
func
main
()
{
// Parse the command-line
printVersion
:=
flag
.
Bool
(
"version"
,
false
,
"Print version and exit"
)
listenAddr
:=
flag
.
String
(
"listenAddr"
,
"localhost:8181"
,
"Listen address for HTTP server"
)
listenNetwork
:=
flag
.
String
(
"listenNetwork"
,
"tcp"
,
"Listen 'network' (protocol)"
)
listenUmask
:=
flag
.
Int
(
"listenUmask"
,
022
,
"Umask for Unix socket, default: 022"
)
authBackend
:=
flag
.
String
(
"authBackend"
,
"http://localhost:8080"
,
"Authentication/authorization backend"
)
flag
.
Usage
=
func
()
{
fmt
.
Fprintf
(
os
.
Stderr
,
"Usage of %s:
\n
"
,
os
.
Args
[
0
])
fmt
.
Fprintf
(
os
.
Stderr
,
"
\n
%s [OPTIONS] REPO_ROOT
\n\n
Options:
\n
"
,
os
.
Args
[
0
])
flag
.
PrintDefaults
()
}
flag
.
Parse
()
if
*
printVersion
{
fmt
.
Printf
(
"gitlab-git-http-server %s
\n
"
,
Version
)
os
.
Exit
(
0
)
}
repoRoot
:=
flag
.
Arg
(
0
)
if
repoRoot
==
""
{
flag
.
Usage
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment