mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 00:38:33 +02:00
Align variable names with main
This commit is contained in:
@@ -9,12 +9,12 @@ import (
|
|||||||
|
|
||||||
idlewatcher "github.com/yusing/godoxy/internal/idlewatcher/types"
|
idlewatcher "github.com/yusing/godoxy/internal/idlewatcher/types"
|
||||||
"github.com/yusing/godoxy/internal/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) {
|
func DebugHandler(rw http.ResponseWriter, r *http.Request) {
|
||||||
w := &Watcher{
|
w := &Watcher{
|
||||||
events: gevents.NewHistory(),
|
events: events.NewHistory(),
|
||||||
cfg: &types.IdlewatcherConfig{
|
cfg: &types.IdlewatcherConfig{
|
||||||
IdlewatcherProviderConfig: types.IdlewatcherProviderConfig{
|
IdlewatcherProviderConfig: types.IdlewatcherProviderConfig{
|
||||||
Docker: &types.DockerConfig{
|
Docker: &types.DockerConfig{
|
||||||
|
|||||||
@@ -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) {
|
func (p *DockerProvider) Watch(ctx context.Context) (eventCh <-chan watcher.Event, errCh <-chan error) {
|
||||||
return p.watcher.EventsWithOptions(ctx, watcher.DockerListOptions{
|
return p.watcher.EventsWithOptions(ctx, watcher.DockerListOptions{
|
||||||
Filters: watcher.NewDockerFilter(
|
Filters: watcher.NewDockerFilters(
|
||||||
watcher.DockerFilterContainer,
|
watcher.DockerFilterContainer,
|
||||||
watcher.DockerFilterContainerNameID(p.containerID),
|
watcher.DockerFilterContainerNameID(p.containerID),
|
||||||
watcher.DockerFilterStart,
|
watcher.DockerFilterStart,
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import (
|
|||||||
"github.com/yusing/godoxy/internal/types"
|
"github.com/yusing/godoxy/internal/types"
|
||||||
watcherEvents "github.com/yusing/godoxy/internal/watcher/events"
|
watcherEvents "github.com/yusing/godoxy/internal/watcher/events"
|
||||||
gperr "github.com/yusing/goutils/errs"
|
gperr "github.com/yusing/goutils/errs"
|
||||||
gevents "github.com/yusing/goutils/events"
|
"github.com/yusing/goutils/events"
|
||||||
"github.com/yusing/goutils/http/reverseproxy"
|
"github.com/yusing/goutils/http/reverseproxy"
|
||||||
strutils "github.com/yusing/goutils/strings"
|
strutils "github.com/yusing/goutils/strings"
|
||||||
"github.com/yusing/goutils/synk"
|
"github.com/yusing/goutils/synk"
|
||||||
@@ -67,7 +67,7 @@ type (
|
|||||||
task *task.Task
|
task *task.Task
|
||||||
|
|
||||||
// Per-watcher event history (for SSE and debug)
|
// Per-watcher event history (for SSE and debug)
|
||||||
events *gevents.History
|
events *events.History
|
||||||
|
|
||||||
dependsOn []*dependency
|
dependsOn []*dependency
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ func NewWatcher(parent task.Parent, r types.Route, cfg *Config) (*Watcher, error
|
|||||||
idleTicker: time.NewTicker(cfg.IdleTimeout),
|
idleTicker: time.NewTicker(cfg.IdleTimeout),
|
||||||
healthTicker: time.NewTicker(idleWakerCheckInterval),
|
healthTicker: time.NewTicker(idleWakerCheckInterval),
|
||||||
readyNotifyCh: make(chan struct{}, 1), // buffered to avoid blocking
|
readyNotifyCh: make(chan struct{}, 1), // buffered to avoid blocking
|
||||||
events: gevents.NewHistory(),
|
events: events.NewHistory(),
|
||||||
cfg: cfg,
|
cfg: cfg,
|
||||||
routeHelper: routeHelper{
|
routeHelper: routeHelper{
|
||||||
hc: monitor.NewMonitor(r),
|
hc: monitor.NewMonitor(r),
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ type (
|
|||||||
IdlewatcherConfigBase struct {
|
IdlewatcherConfigBase struct {
|
||||||
// 0: no idle watcher.
|
// 0: no idle watcher.
|
||||||
// Positive: idle watcher with idle timeout.
|
// 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"`
|
IdleTimeout time.Duration `json:"idle_timeout"`
|
||||||
WakeTimeout time.Duration `json:"wake_timeout"`
|
WakeTimeout time.Duration `json:"wake_timeout"`
|
||||||
StopTimeout time.Duration `json:"stop_timeout"`
|
StopTimeout time.Duration `json:"stop_timeout"`
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ var (
|
|||||||
DockerFilterPause = filters.Arg("event", string(dockerEvents.ActionPause))
|
DockerFilterPause = filters.Arg("event", string(dockerEvents.ActionPause))
|
||||||
DockerFilterUnpause = filters.Arg("event", string(dockerEvents.ActionUnPause))
|
DockerFilterUnpause = filters.Arg("event", string(dockerEvents.ActionUnPause))
|
||||||
|
|
||||||
NewDockerFilter = filters.NewArgs
|
NewDockerFilters = filters.NewArgs
|
||||||
|
|
||||||
optionsDefault = DockerListOptions{Filters: NewDockerFilter(
|
optionsDefault = DockerListOptions{Filters: NewDockerFilters(
|
||||||
DockerFilterContainer,
|
DockerFilterContainer,
|
||||||
DockerFilterStart,
|
DockerFilterStart,
|
||||||
// DockerFilterStop,
|
// DockerFilterStop,
|
||||||
|
|||||||
Reference in New Issue
Block a user