1
1
/*
2
- * Copyright 2018-2021 Rahul De
2
+ * Copyright 2018- Rahul De
3
3
*
4
4
* Use of this source code is governed by an MIT-style
5
5
* license that can be found in the LICENSE file or at
@@ -25,7 +25,7 @@ import (
25
25
githttp "github.com/go-git/go-git/v5/plumbing/transport/http"
26
26
)
27
27
28
- func Tar (src string , archiveName string ) error {
28
+ func makeTar (src string , archiveName string ) error {
29
29
if _ , err := os .Stat (src ); err != nil {
30
30
return err
31
31
}
@@ -75,11 +75,11 @@ func Tar(src string, archiveName string) error {
75
75
return nil
76
76
}
77
77
78
- func Ping (w http.ResponseWriter , r * http.Request ) {
78
+ func ping (w http.ResponseWriter , r * http.Request ) {
79
79
fmt .Fprint (w , "Ack" )
80
80
}
81
81
82
- func Clone (w http.ResponseWriter , r * http.Request ) {
82
+ func clone (w http.ResponseWriter , r * http.Request ) {
83
83
repo := r .URL .Query ().Get ("repo" )
84
84
branch := r .URL .Query ().Get ("branch" )
85
85
@@ -109,7 +109,7 @@ func Clone(w http.ResponseWriter, r *http.Request) {
109
109
return
110
110
}
111
111
112
- if err := Tar (dir , archive ); err != nil {
112
+ if err := makeTar (dir , archive ); err != nil {
113
113
w .WriteHeader (http .StatusInternalServerError )
114
114
fmt .Fprint (w , err .Error ())
115
115
@@ -133,8 +133,8 @@ func main() {
133
133
134
134
client .InstallProtocol ("https" , githttp .NewClient (customClient ))
135
135
136
- http .HandleFunc ("/ping" , Ping )
137
- http .HandleFunc ("/bob_resource" , Clone )
136
+ http .HandleFunc ("/ping" , ping )
137
+ http .HandleFunc ("/bob_resource" , clone )
138
138
139
139
http .ListenAndServe (":" + port , nil )
140
140
}
0 commit comments