Switch remote deploy to vendored source builds
Move remote deployment to a vendored source bundle built on the target host via Docker so redeploys no longer require local cross-compilation or host Go installation. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
43
vendor/github.com/bep/debounce/debounce.go
generated
vendored
Normal file
43
vendor/github.com/bep/debounce/debounce.go
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright © 2019 Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>.
|
||||
//
|
||||
// Use of this source code is governed by an MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package debounce provides a debouncer func. The most typical use case would be
|
||||
// the user typing a text into a form; the UI needs an update, but let's wait for
|
||||
// a break.
|
||||
package debounce
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// New returns a debounced function that takes another functions as its argument.
|
||||
// This function will be called when the debounced function stops being called
|
||||
// for the given duration.
|
||||
// The debounced function can be invoked with different functions, if needed,
|
||||
// the last one will win.
|
||||
func New(after time.Duration) func(f func()) {
|
||||
d := &debouncer{after: after}
|
||||
|
||||
return func(f func()) {
|
||||
d.add(f)
|
||||
}
|
||||
}
|
||||
|
||||
type debouncer struct {
|
||||
mu sync.Mutex
|
||||
after time.Duration
|
||||
timer *time.Timer
|
||||
}
|
||||
|
||||
func (d *debouncer) add(f func()) {
|
||||
d.mu.Lock()
|
||||
defer d.mu.Unlock()
|
||||
|
||||
if d.timer != nil {
|
||||
d.timer.Stop()
|
||||
}
|
||||
d.timer = time.AfterFunc(d.after, f)
|
||||
}
|
||||
Reference in New Issue
Block a user