From 0d50bf1ddf81c6fe4866b4ba400b7962d3fb5df7 Mon Sep 17 00:00:00 2001 From: yusing Date: Sat, 28 Feb 2026 19:44:07 +0800 Subject: [PATCH] Align variable names with main --- internal/idlewatcher/handle_http_debug.go | 4 ++-- internal/idlewatcher/provider/docker.go | 2 +- internal/idlewatcher/watcher.go | 6 +++--- internal/types/idlewatcher.go | 2 +- internal/watcher/docker_watcher.go | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/internal/idlewatcher/handle_http_debug.go b/internal/idlewatcher/handle_http_debug.go index 2076aff0..368cc0b1 100644 --- a/internal/idlewatcher/handle_http_debug.go +++ b/internal/idlewatcher/handle_http_debug.go @@ -9,12 +9,12 @@ import ( idlewatcher "github.com/yusing/godoxy/internal/idlewatcher/types" "github.com/yusing/godoxy/internal/types" - gevents "github.com/yusing/goutils/events" + "github.com/yusing/goutils/events" ) func DebugHandler(rw http.ResponseWriter, r *http.Request) { w := &Watcher{ - events: gevents.NewHistory(), + events: events.NewHistory(), cfg: &types.IdlewatcherConfig{ IdlewatcherProviderConfig: types.IdlewatcherProviderConfig{ Docker: &types.DockerConfig{ diff --git a/internal/idlewatcher/provider/docker.go b/internal/idlewatcher/provider/docker.go index 740b5c83..42734cf7 100644 --- a/internal/idlewatcher/provider/docker.go +++ b/internal/idlewatcher/provider/docker.go @@ -72,7 +72,7 @@ func (p *DockerProvider) ContainerStatus(ctx context.Context) (idlewatcher.Conta func (p *DockerProvider) Watch(ctx context.Context) (eventCh <-chan watcher.Event, errCh <-chan error) { return p.watcher.EventsWithOptions(ctx, watcher.DockerListOptions{ - Filters: watcher.NewDockerFilter( + Filters: watcher.NewDockerFilters( watcher.DockerFilterContainer, watcher.DockerFilterContainerNameID(p.containerID), watcher.DockerFilterStart, diff --git a/internal/idlewatcher/watcher.go b/internal/idlewatcher/watcher.go index aede7dcc..483fe5f1 100644 --- a/internal/idlewatcher/watcher.go +++ b/internal/idlewatcher/watcher.go @@ -22,7 +22,7 @@ import ( "github.com/yusing/godoxy/internal/types" watcherEvents "github.com/yusing/godoxy/internal/watcher/events" gperr "github.com/yusing/goutils/errs" - gevents "github.com/yusing/goutils/events" + "github.com/yusing/goutils/events" "github.com/yusing/goutils/http/reverseproxy" strutils "github.com/yusing/goutils/strings" "github.com/yusing/goutils/synk" @@ -67,7 +67,7 @@ type ( task *task.Task // Per-watcher event history (for SSE and debug) - events *gevents.History + events *events.History dependsOn []*dependency } @@ -132,7 +132,7 @@ func NewWatcher(parent task.Parent, r types.Route, cfg *Config) (*Watcher, error idleTicker: time.NewTicker(cfg.IdleTimeout), healthTicker: time.NewTicker(idleWakerCheckInterval), readyNotifyCh: make(chan struct{}, 1), // buffered to avoid blocking - events: gevents.NewHistory(), + events: events.NewHistory(), cfg: cfg, routeHelper: routeHelper{ hc: monitor.NewMonitor(r), diff --git a/internal/types/idlewatcher.go b/internal/types/idlewatcher.go index 6b7ca36a..f00e02d0 100644 --- a/internal/types/idlewatcher.go +++ b/internal/types/idlewatcher.go @@ -18,7 +18,7 @@ type ( IdlewatcherConfigBase struct { // 0: no idle watcher. // Positive: idle watcher with idle timeout. - // Negative: idle watcher as a dependency. IdleTimeout time.Duration `json:"idle_timeout" json_ext:"duration"` + // Negative: idle watcher as a dependency. IdleTimeout time.Duration `json:"idle_timeout"` WakeTimeout time.Duration `json:"wake_timeout"` StopTimeout time.Duration `json:"stop_timeout"` diff --git a/internal/watcher/docker_watcher.go b/internal/watcher/docker_watcher.go index c92cbd58..b78d5265 100644 --- a/internal/watcher/docker_watcher.go +++ b/internal/watcher/docker_watcher.go @@ -33,9 +33,9 @@ var ( DockerFilterPause = filters.Arg("event", string(dockerEvents.ActionPause)) DockerFilterUnpause = filters.Arg("event", string(dockerEvents.ActionUnPause)) - NewDockerFilter = filters.NewArgs + NewDockerFilters = filters.NewArgs - optionsDefault = DockerListOptions{Filters: NewDockerFilter( + optionsDefault = DockerListOptions{Filters: NewDockerFilters( DockerFilterContainer, DockerFilterStart, // DockerFilterStop,