aboutsummaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
authorHenrique Dias <hacdias@gmail.com>2023-11-07 20:45:45 +0100
committerGitHub <noreply@github.com>2023-11-07 11:45:45 -0800
commit550450a3b1e07a70a506d872137ea43774d2c5e0 (patch)
treed75e2174eeb6ba9197fbf70ce97f3567a6322859 /handler.go
parent35e7777d1a11bff5e192aaae3145685a6a2aec60 (diff)
downloadsally-550450a3b1e07a70a506d872137ea43774d2c5e0.tar.gz
feat: add support for other vcs systems (#128)
Adds support to other VCS systems as per the specification. Defaults to `git` for backwards compatibility. Renames the internally used `.GitURL` to `.RepoURL` for clarity.
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/handler.go b/handler.go
index f636359..ccf8d27 100644
--- a/handler.go
+++ b/handler.go
@@ -49,7 +49,8 @@ func CreateHandler(config *Config) http.Handler {
Desc: pkg.Desc,
ModulePath: modulePath,
DocURL: docURL,
- GitURL: pkg.Repo,
+ VCS: pkg.VCS,
+ RepoURL: pkg.Repo,
}
pkgs = append(pkgs, pkg)
@@ -90,8 +91,11 @@ type sallyPackage struct {
// URL at which documentation for the package can be found.
DocURL string
- // URL at which the Git repository is hosted.
- GitURL string
+ // Version control system used by the package.
+ VCS string
+
+ // URL at which the repository is hosted.
+ RepoURL string
}
type indexHandler struct {
@@ -169,11 +173,13 @@ func (h *packageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
err := packageTemplate.Execute(w, struct {
ModulePath string
- GitURL string
+ VCS string
+ RepoURL string
DocURL string
}{
ModulePath: h.Pkg.ModulePath,
- GitURL: h.Pkg.GitURL,
+ VCS: h.Pkg.VCS,
+ RepoURL: h.Pkg.RepoURL,
DocURL: h.Pkg.DocURL + relPath,
})
if err != nil {