-
Notifications
You must be signed in to change notification settings - Fork 1
/
git.go
38 lines (31 loc) · 930 Bytes
/
git.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
package cfghttp
import (
"net/http"
"gopkg.xa4b.com/git/cfg"
)
// GitServer is the interface used to interact with the git server via HTTP
type GitServer interface {
NewInfoRefs(repoName string) InfoRefser
NewReceivePack(repoName string) ReceivePacker
NewUploadPack(repoName string) UploadPacker
WithLogger(...interface{})
WithPreReceiveHook(cfg.PreReceivePackHookFunc)
WithPostReceiveHook(cfg.PostReceivePackHookFunc)
}
// InfoRefser returns HTTP requests for '/info/ref'
type InfoRefser interface {
DoHTTP(http.ResponseWriter, *http.Request) InfoRefser
Err() error
}
// ReceivePacker returns HTTP requests for '/receive-pack'
type ReceivePacker interface {
DoHTTP(http.ResponseWriter, *http.Request) ReceivePacker
Cleanup()
Err() error
}
// UploadPacker returns HTTP requests for '/upload-pack'
type UploadPacker interface {
DoHTTP(http.ResponseWriter, *http.Request) UploadPacker
Cleanup()
Err() error
}