refactor: project structure

This commit is contained in:
2024-04-29 21:29:05 +02:00
parent 2abed91918
commit 727b083e52
7 changed files with 45 additions and 15 deletions

View File

@@ -4,13 +4,13 @@ import (
"errors"
"log"
pkgwatcher "gitea.urkob.com/urko/git-webhook-ci/pkg/watcher"
"gitea.urkob.com/urko/git-webhook-ci/pkg"
"github.com/fsnotify/fsnotify"
)
type watcher struct {
fswatcher *fsnotify.Watcher
deploy pkgwatcher.DeployFunc
deploy pkg.DeployFunc
}
type notifier struct{}
@@ -28,7 +28,7 @@ var (
errErrorsClosedChan = errors.New("errors is closed")
)
func NewWatcher(notifier pkgwatcher.NotifyIface, deploy pkgwatcher.DeployFunc) *watcher {
func NewWatcher(notifier pkg.NotifyIface, deploy pkg.DeployFunc) *watcher {
wt, err := notifier.NewWatcher()
if err != nil {
log.Printf("fsnotify.NewWatcher: %s\n", err)

View File

@@ -6,8 +6,8 @@ import (
"testing"
"time"
"gitea.urkob.com/urko/git-webhook-ci/cfg"
pkgwatcher "gitea.urkob.com/urko/git-webhook-ci/pkg/watcher"
"gitea.urkob.com/urko/git-webhook-ci/kit/cfg"
"gitea.urkob.com/urko/git-webhook-ci/pkg"
"github.com/fsnotify/fsnotify"
"github.com/stretchr/testify/require"
)
@@ -26,8 +26,8 @@ var (
)
var (
mockDeploy pkgwatcher.DeployFunc
mockErrorDeploy pkgwatcher.DeployFunc
mockDeploy pkg.DeployFunc
mockErrorDeploy pkg.DeployFunc
errIntentional = errors.New("intentional error")
binaryPath = ""
scriptPath = ""