refactor: project structure
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 = ""
|
||||
|
||||
Reference in New Issue
Block a user