aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/git/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/handler/git/handler.go')
-rw-r--r--pkg/handler/git/handler.go19
1 files changed, 2 insertions, 17 deletions
diff --git a/pkg/handler/git/handler.go b/pkg/handler/git/handler.go
index 5e50122..9549f0e 100644
--- a/pkg/handler/git/handler.go
+++ b/pkg/handler/git/handler.go
@@ -18,7 +18,6 @@ import (
"github.com/alecthomas/chroma/v2/formatters/html"
"github.com/alecthomas/chroma/v2/lexers"
"github.com/alecthomas/chroma/v2/styles"
- "github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
"github.com/gomarkdown/markdown"
markdownhtml "github.com/gomarkdown/markdown/html"
@@ -27,30 +26,16 @@ import (
type (
GitHandler struct {
- gitService gitService
+ gitService *service.GitService
readmePath string
}
- gitService interface {
- ListRepositories() ([]*service.Repository, error)
- ListCommits(name string, ref string, count int) ([]*object.Commit, error)
- LastCommit(name string, ref string) (*object.Commit, error)
- GetHead(name string) (*plumbing.Reference, error)
- GetTree(name, ref, path string) (*object.Tree, error)
- IsBinary(name, ref, path string) (bool, error)
- GetFileContent(name, ref, path string) ([]byte, error)
- GetAbout(name string) ([]byte, error)
- ListTags(name string) ([]*plumbing.Reference, error)
- ListBranches(name string) ([]*plumbing.Reference, error)
- WriteTarGZip(w io.Writer, name, ref, prefix string) error
- }
-
configurationRepository interface {
GetRootReadme() string
}
)
-func NewGitHandler(gitService gitService, confRepo configurationRepository) *GitHandler {
+func NewGitHandler(gitService *service.GitService, confRepo configurationRepository) *GitHandler {
return &GitHandler{
gitService: gitService,
readmePath: confRepo.GetRootReadme(),