fswatch

package
v0.13.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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
View Source
const DetectedOverflowErrMsg = `` /* 189-byte string literal not displayed */

Variables

View Source
var BufferMaxDuration = BufferMaxTimeInMs * time.Millisecond
View Source
var BufferMinRestDuration = BufferMinRestInMs * time.Millisecond
View Source
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

func (*FakeMultiWatcher) NewSub

func (w *FakeMultiWatcher) NewSub(paths []string, ignore watch.PathMatcher, _ logger.Logger) (watch.Notify, error)

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 TargetFilesChangedAction

type TargetFilesChangedAction struct {
	TargetID model.TargetID
	Files    []string
	Time     time.Time
}

func NewTargetFilesChangedAction

func NewTargetFilesChangedAction(targetID model.TargetID, files ...string) TargetFilesChangedAction

func (TargetFilesChangedAction) Action

func (TargetFilesChangedAction) Action()

type TimerMaker

type TimerMaker func(d time.Duration) <-chan time.Time

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL