Align variable names with main

This commit is contained in:
yusing
2026-02-28 19:44:07 +08:00
parent afa5d94d5f
commit 0d50bf1ddf
5 changed files with 9 additions and 9 deletions

View File

@@ -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{

View File

@@ -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,

View File

@@ -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),

View File

@@ -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"`

View File

@@ -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,