Documentation ¶
Index ¶
Constants ¶
const BufferMaxTimeInMs = 10000
When waiting for a `watchBufferDurationInMs`-long break in file modifications to aggregate notifications, if we haven't seen a break by the time `watchBufferMaxTimeInMs` has passed, just send off whatever we've got
const BufferMinRestInMs = 200
When we see a file change, wait this long to see if any other files have changed, and bundle all changes together. 200ms is not the result of any kind of research or experimentation it might end up being a significant part of deployment delay, if we get the total latency <2s it might also be long enough that it misses some changes if the user has some operation involving a large file
(e.g., a binary dependency in git), but that's hopefully less of a problem since we'd get it in the next build
const DetectedOverflowErrMsg = `` /* 189-byte string literal not displayed */
Variables ¶
var BufferMaxDuration = BufferMaxTimeInMs * time.Millisecond
var BufferMinRestDuration = BufferMinRestInMs * time.Millisecond
var ConfigsTargetID = model.TargetID{ Type: model.TargetTypeConfigs, Name: "singleton", }
Functions ¶
This section is empty.
Types ¶
type FakeMultiWatcher ¶
type FakeMultiWatcher struct { Events chan watch.FileEvent Errors chan error // contains filtered or unexported fields }
func NewFakeMultiWatcher ¶
func NewFakeMultiWatcher() *FakeMultiWatcher
type FakeTimerMaker ¶
type FakeTimerMaker struct { RestTimerLock *sync.Mutex MaxTimerLock *sync.Mutex // contains filtered or unexported fields }
func MakeFakeTimerMaker ¶
func MakeFakeTimerMaker(t *testing.T) FakeTimerMaker
func (FakeTimerMaker) Maker ¶
func (f FakeTimerMaker) Maker() TimerMaker
type FakeWatcher ¶
type FakeWatcher struct {
// contains filtered or unexported fields
}
func NewFakeWatcher ¶
func NewFakeWatcher(inboundCh chan watch.FileEvent, errorCh chan error, paths []string, ignore watch.PathMatcher) *FakeWatcher
func (*FakeWatcher) Close ¶
func (w *FakeWatcher) Close() error
func (*FakeWatcher) Errors ¶
func (w *FakeWatcher) Errors() chan error
func (*FakeWatcher) Events ¶
func (w *FakeWatcher) Events() chan watch.FileEvent
func (*FakeWatcher) Start ¶
func (w *FakeWatcher) Start() error
type FsWatcherMaker ¶
type FsWatcherMaker func(paths []string, ignore watch.PathMatcher, l logger.Logger) (watch.Notify, error)
func ProvideFsWatcherMaker ¶
func ProvideFsWatcherMaker() FsWatcherMaker
type GitBranchStatusAction ¶ added in v0.17.3
type GitBranchStatusAction struct { Time time.Time Repo model.LocalGitRepo Head string }
func (GitBranchStatusAction) Action ¶ added in v0.17.3
func (GitBranchStatusAction) Action()
type GitManager ¶ added in v0.17.3
type GitManager struct {
// contains filtered or unexported fields
}
Watches git for branch switches and fires events.
func NewGitManager ¶ added in v0.17.3
func NewGitManager(fsWatcherMaker FsWatcherMaker) *GitManager
type TargetFilesChangedAction ¶
func NewTargetFilesChangedAction ¶
func NewTargetFilesChangedAction(targetID model.TargetID, files ...string) TargetFilesChangedAction
func (TargetFilesChangedAction) Action ¶
func (TargetFilesChangedAction) Action()
type TimerMaker ¶
func ProvideTimerMaker ¶
func ProvideTimerMaker() TimerMaker
type WatchManager ¶
type WatchManager struct {
// contains filtered or unexported fields
}
func NewWatchManager ¶
func NewWatchManager(watcherMaker FsWatcherMaker, timerMaker TimerMaker) *WatchManager
func (*WatchManager) DisableForTesting ¶
func (w *WatchManager) DisableForTesting()
func (*WatchManager) OnChange ¶
func (w *WatchManager) OnChange(ctx context.Context, st store.RStore)
func (*WatchManager) TargetWatchCount ¶
func (w *WatchManager) TargetWatchCount() int
type WatchableTarget ¶
type WatchableTarget interface { ignore.IgnorableTarget Dependencies() []string ID() model.TargetID }
If you modify this interface, you might also need to update the watchRulesMatch function below.
func WatchableTargetsForManifests ¶
func WatchableTargetsForManifests(manifests []model.Manifest) []WatchableTarget