Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( InfoRefsRegExp = regexp.MustCompile(`/(.+\.git)/info/refs$`) UploadPackRegExp = regexp.MustCompile(`/(.+\.git)/git-upload-pack$`) ReceivePackRegExp = regexp.MustCompile(`/(.+\.git)/git-receive-pack$`) FetchFileRegExp = regexp.MustCompile(`/(.+\.git)/raw/(.+?)/(.+)`) )
View Source
var ErrWrongRepoPath = errors.New("wrong repository path")
Functions ¶
Types ¶
type FetchFileData ¶
func ParseFetchFilePath ¶
func ParseFetchFilePath(path string) (*FetchFileData, error)
type FetchFileHandler ¶
type FetchFileHandler struct {
// contains filtered or unexported fields
}
func NewFetchFileHandler ¶
func NewFetchFileHandler(log zerolog.Logger, reposDir string, repoAbsPathFunc RepoAbsPathFunc) *FetchFileHandler
func (*FetchFileHandler) ServeHTTP ¶
func (h *FetchFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GitSmartHandler ¶
type GitSmartHandler struct {
// contains filtered or unexported fields
}
func NewGitSmartHandler ¶
func NewGitSmartHandler(log zerolog.Logger, reposDir string, createRepo bool, repoAbsPathFunc RepoAbsPathFunc, repoPostCreateFunc RepoPostCreateFunc) *GitSmartHandler
func (*GitSmartHandler) ServeHTTP ¶
func (h *GitSmartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RepoAbsPathFunc ¶
RepoAbsPathFunc is a user defined functions that, given the repo path provided in the url request, will return the file system absolute repo path and if it exists. This function should also do path validation and return ErrWrongRepoPath if path validation failed.
type RepoPostCreateFunc ¶
type RequestType ¶
type RequestType int
const ( RequestTypeInfoRefs RequestType = iota RequestTypeUploadPack RequestTypeReceivePack )
Click to show internal directories.
Click to hide internal directories.