aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/hpcloud/tail/watch/filechanges.go
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-03-29 13:07:43 +0200
committerValentin Rothberg <vrothberg@redhat.com>2022-03-29 13:35:37 +0200
commit21502987b2318292bf98e3ef502fb4c0cf9a6d58 (patch)
tree8a2972a6d8ce1d38445ae8be751da3d1cf7a6ff9 /vendor/github.com/hpcloud/tail/watch/filechanges.go
parenta2d7fb0c66441450c9169bebdefa07993759fa5b (diff)
downloadpodman-21502987b2318292bf98e3ef502fb4c0cf9a6d58.tar.gz
podman-21502987b2318292bf98e3ef502fb4c0cf9a6d58.tar.bz2
podman-21502987b2318292bf98e3ef502fb4c0cf9a6d58.zip
replace hpcloud/tail with nxadm/tail
The hpcloud is not maintained anymore. nxadm is already part of the dependency chain, so it won't add work for downstream packages. While testing upcoming changes to the events-file backend, I noticed that nxadm is shipping required fixes. [NO NEW TESTS NEEDED] Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/hpcloud/tail/watch/filechanges.go')
-rw-r--r--vendor/github.com/hpcloud/tail/watch/filechanges.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/github.com/hpcloud/tail/watch/filechanges.go b/vendor/github.com/hpcloud/tail/watch/filechanges.go
deleted file mode 100644
index 3ce5dcecb..000000000
--- a/vendor/github.com/hpcloud/tail/watch/filechanges.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package watch
-
-type FileChanges struct {
- Modified chan bool // Channel to get notified of modifications
- Truncated chan bool // Channel to get notified of truncations
- Deleted chan bool // Channel to get notified of deletions/renames
-}
-
-func NewFileChanges() *FileChanges {
- return &FileChanges{
- make(chan bool), make(chan bool), make(chan bool)}
-}
-
-func (fc *FileChanges) NotifyModified() {
- sendOnlyIfEmpty(fc.Modified)
-}
-
-func (fc *FileChanges) NotifyTruncated() {
- sendOnlyIfEmpty(fc.Truncated)
-}
-
-func (fc *FileChanges) NotifyDeleted() {
- sendOnlyIfEmpty(fc.Deleted)
-}
-
-// sendOnlyIfEmpty sends on a bool channel only if the channel has no
-// backlog to be read by other goroutines. This concurrency pattern
-// can be used to notify other goroutines if and only if they are
-// looking for it (i.e., subsequent notifications can be compressed
-// into one).
-func sendOnlyIfEmpty(ch chan bool) {
- select {
- case ch <- true:
- default:
- }
-}