summaryrefslogtreecommitdiff
path: root/vendor/github.com/hpcloud/tail/watch/filechanges.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-02-06 09:07:51 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-09 15:27:52 +0000
commitfa9658cbfaa94fd5d0425041404e498c01db1aa3 (patch)
tree3cacae5b613692387780209a5d41b10c2edc0940 /vendor/github.com/hpcloud/tail/watch/filechanges.go
parent75914199f331a10eb7ed44de68c738515bdd5b2d (diff)
downloadpodman-fa9658cbfaa94fd5d0425041404e498c01db1aa3.tar.gz
podman-fa9658cbfaa94fd5d0425041404e498c01db1aa3.tar.bz2
podman-fa9658cbfaa94fd5d0425041404e498c01db1aa3.zip
podman logs: fix tailing
Fix issues with tailing of container logs as described in issue #16. Also add in the ability to use a duration or known time stamp formats for the --since flag. Signed-off-by: baude <bbaude@redhat.com> Closes: #317 Approved by: mheon
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:
- }
-}