Merge pull request #72 from miraclesu/fix/watch_create
fix block until exists function
This commit is contained in:
commit
1a0242e795
|
@ -1,14 +1,13 @@
|
||||||
language: go
|
language: go
|
||||||
|
|
||||||
# depman needs to be installed with GOPATH pointing to a single directory.
|
|
||||||
script:
|
script:
|
||||||
- GOPATH=$HOME/gopath go get github.com/vube/depman
|
- go test -race -v ./...
|
||||||
- GOPATH=$HOME/gopath $HOME/gopath/bin/depman
|
|
||||||
- go test -v ./...
|
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- 1.3.3
|
- 1.3.3
|
||||||
- 1.4.2
|
- 1.4.3
|
||||||
|
- 1.5.2
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- go get gopkg.in/fsnotify.v1
|
- go get gopkg.in/fsnotify.v1
|
||||||
|
- go get gopkg.in/tomb.v1
|
||||||
|
|
21
tail.go
21
tail.go
|
@ -10,6 +10,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hpcloud/tail/ratelimiter"
|
"github.com/hpcloud/tail/ratelimiter"
|
||||||
|
@ -82,6 +83,8 @@ type Tail struct {
|
||||||
changes *watch.FileChanges
|
changes *watch.FileChanges
|
||||||
|
|
||||||
tomb.Tomb // provides: Done, Kill, Dying
|
tomb.Tomb // provides: Done, Kill, Dying
|
||||||
|
|
||||||
|
lk sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -140,7 +143,9 @@ func (tail *Tail) Tell() (offset int64, err error) {
|
||||||
}
|
}
|
||||||
offset, err = tail.file.Seek(0, os.SEEK_CUR)
|
offset, err = tail.file.Seek(0, os.SEEK_CUR)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
tail.lk.Lock()
|
||||||
offset -= int64(tail.reader.Buffered())
|
offset -= int64(tail.reader.Buffered())
|
||||||
|
tail.lk.Unlock()
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -153,15 +158,18 @@ func (tail *Tail) Stop() error {
|
||||||
|
|
||||||
func (tail *Tail) close() {
|
func (tail *Tail) close() {
|
||||||
close(tail.Lines)
|
close(tail.Lines)
|
||||||
|
tail.colseFile()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (tail *Tail) colseFile() {
|
||||||
if tail.file != nil {
|
if tail.file != nil {
|
||||||
tail.file.Close()
|
tail.file.Close()
|
||||||
|
tail.file = nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tail *Tail) reopen() error {
|
func (tail *Tail) reopen() error {
|
||||||
if tail.file != nil {
|
tail.colseFile()
|
||||||
tail.file.Close()
|
|
||||||
}
|
|
||||||
for {
|
for {
|
||||||
var err error
|
var err error
|
||||||
tail.file, err = OpenFile(tail.Filename)
|
tail.file, err = OpenFile(tail.Filename)
|
||||||
|
@ -184,7 +192,9 @@ func (tail *Tail) reopen() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tail *Tail) readLine() (string, error) {
|
func (tail *Tail) readLine() (string, error) {
|
||||||
|
tail.lk.Lock()
|
||||||
line, err := tail.reader.ReadString('\n')
|
line, err := tail.reader.ReadString('\n')
|
||||||
|
tail.lk.Unlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Note ReadString "returns the data read before the error" in
|
// Note ReadString "returns the data read before the error" in
|
||||||
// case of an error, including EOF, so we return it as is. The
|
// case of an error, including EOF, so we return it as is. The
|
||||||
|
@ -312,7 +322,10 @@ func (tail *Tail) waitForChanges() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
tail.changes = tail.watcher.ChangeEvents(&tail.Tomb, pos)
|
tail.changes, err = tail.watcher.ChangeEvents(&tail.Tomb, pos)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
|
24
tail_test.go
24
tail_test.go
|
@ -155,7 +155,7 @@ func TestLocationEnd(_t *testing.T) {
|
||||||
|
|
||||||
func TestLocationMiddle(_t *testing.T) {
|
func TestLocationMiddle(_t *testing.T) {
|
||||||
// Test reading from middle.
|
// Test reading from middle.
|
||||||
t := NewTailTest("location-end", _t)
|
t := NewTailTest("location-middle", _t)
|
||||||
t.CreateFile("test.txt", "hello\nworld\n")
|
t.CreateFile("test.txt", "hello\nworld\n")
|
||||||
tail := t.StartTail("test.txt", Config{Follow: true, Location: &SeekInfo{-6, os.SEEK_END}})
|
tail := t.StartTail("test.txt", Config{Follow: true, Location: &SeekInfo{-6, os.SEEK_END}})
|
||||||
go t.VerifyTailOutput(tail, []string{"world", "more", "data"})
|
go t.VerifyTailOutput(tail, []string{"world", "more", "data"})
|
||||||
|
@ -331,6 +331,28 @@ func TestTell(_t *testing.T) {
|
||||||
tail.Cleanup()
|
tail.Cleanup()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestBlockUntilExists(_t *testing.T) {
|
||||||
|
t := NewTailTest("block-until-file-exists", _t)
|
||||||
|
config := Config{
|
||||||
|
Follow: true,
|
||||||
|
}
|
||||||
|
tail := t.StartTail("test.txt", config)
|
||||||
|
go func() {
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
|
t.CreateFile("test.txt", "hello world\n")
|
||||||
|
}()
|
||||||
|
for l := range tail.Lines {
|
||||||
|
if l.Text != "hello world" {
|
||||||
|
t.Fatalf("mismatch; expected hello world, but got %s",
|
||||||
|
l.Text)
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
t.RemoveFile("test.txt")
|
||||||
|
tail.Stop()
|
||||||
|
tail.Cleanup()
|
||||||
|
}
|
||||||
|
|
||||||
// Test library
|
// Test library
|
||||||
|
|
||||||
type TailTest struct {
|
type TailTest struct {
|
||||||
|
|
|
@ -20,19 +20,16 @@ type InotifyFileWatcher struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewInotifyFileWatcher(filename string) *InotifyFileWatcher {
|
func NewInotifyFileWatcher(filename string) *InotifyFileWatcher {
|
||||||
fw := &InotifyFileWatcher{filename, 0}
|
fw := &InotifyFileWatcher{filepath.Clean(filename), 0}
|
||||||
return fw
|
return fw
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error {
|
func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error {
|
||||||
dirname := filepath.Dir(fw.Filename)
|
err := WatchCreate(fw.Filename)
|
||||||
|
|
||||||
// Watch for new files to be created in the parent directory.
|
|
||||||
err := Watch(dirname)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer RemoveWatch(dirname)
|
defer RemoveWatchCreate(fw.Filename)
|
||||||
|
|
||||||
// Do a real check now as the file might have been created before
|
// Do a real check now as the file might have been created before
|
||||||
// calling `WatchFlags` above.
|
// calling `WatchFlags` above.
|
||||||
|
@ -48,7 +45,7 @@ func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error {
|
||||||
case evt, ok := <-events:
|
case evt, ok := <-events:
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("inotify watcher has been closed")
|
return fmt.Errorf("inotify watcher has been closed")
|
||||||
} else if evt.Name == fw.Filename {
|
} else if filepath.Clean(evt.Name) == fw.Filename {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
case <-t.Dying():
|
case <-t.Dying():
|
||||||
|
@ -58,14 +55,13 @@ func (fw *InotifyFileWatcher) BlockUntilExists(t *tomb.Tomb) error {
|
||||||
panic("unreachable")
|
panic("unreachable")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fw *InotifyFileWatcher) ChangeEvents(t *tomb.Tomb, pos int64) *FileChanges {
|
func (fw *InotifyFileWatcher) ChangeEvents(t *tomb.Tomb, pos int64) (*FileChanges, error) {
|
||||||
changes := NewFileChanges()
|
|
||||||
|
|
||||||
err := Watch(fw.Filename)
|
err := Watch(fw.Filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
go changes.NotifyDeleted()
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changes := NewFileChanges()
|
||||||
fw.Size = pos
|
fw.Size = pos
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
@ -119,5 +115,5 @@ func (fw *InotifyFileWatcher) ChangeEvents(t *tomb.Tomb, pos int64) *FileChanges
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return changes
|
return changes, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ package watch
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
@ -18,15 +19,21 @@ type InotifyTracker struct {
|
||||||
watcher *fsnotify.Watcher
|
watcher *fsnotify.Watcher
|
||||||
chans map[string]chan fsnotify.Event
|
chans map[string]chan fsnotify.Event
|
||||||
done map[string]chan bool
|
done map[string]chan bool
|
||||||
|
watchNums map[string]int
|
||||||
watch chan *watchInfo
|
watch chan *watchInfo
|
||||||
remove chan string
|
remove chan *watchInfo
|
||||||
error chan error
|
error chan error
|
||||||
}
|
}
|
||||||
|
|
||||||
type watchInfo struct {
|
type watchInfo struct {
|
||||||
|
op fsnotify.Op
|
||||||
fname string
|
fname string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *watchInfo) isCreate() bool {
|
||||||
|
return this.op == fsnotify.Create
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// globally shared InotifyTracker; ensures only one fsnotify.Watcher is used
|
// globally shared InotifyTracker; ensures only one fsnotify.Watcher is used
|
||||||
shared *InotifyTracker
|
shared *InotifyTracker
|
||||||
|
@ -38,8 +45,9 @@ var (
|
||||||
mux: sync.Mutex{},
|
mux: sync.Mutex{},
|
||||||
chans: make(map[string]chan fsnotify.Event),
|
chans: make(map[string]chan fsnotify.Event),
|
||||||
done: make(map[string]chan bool),
|
done: make(map[string]chan bool),
|
||||||
|
watchNums: make(map[string]int),
|
||||||
watch: make(chan *watchInfo),
|
watch: make(chan *watchInfo),
|
||||||
remove: make(chan string),
|
remove: make(chan *watchInfo),
|
||||||
error: make(chan error),
|
error: make(chan error),
|
||||||
}
|
}
|
||||||
go shared.run()
|
go shared.run()
|
||||||
|
@ -50,29 +58,58 @@ var (
|
||||||
|
|
||||||
// Watch signals the run goroutine to begin watching the input filename
|
// Watch signals the run goroutine to begin watching the input filename
|
||||||
func Watch(fname string) error {
|
func Watch(fname string) error {
|
||||||
|
return watch(&watchInfo{
|
||||||
|
fname: fname,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// Watch create signals the run goroutine to begin watching the input filename
|
||||||
|
// if call the WatchCreate function, don't call the Cleanup, call the RemoveWatchCreate
|
||||||
|
func WatchCreate(fname string) error {
|
||||||
|
return watch(&watchInfo{
|
||||||
|
op: fsnotify.Create,
|
||||||
|
fname: fname,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func watch(winfo *watchInfo) error {
|
||||||
// start running the shared InotifyTracker if not already running
|
// start running the shared InotifyTracker if not already running
|
||||||
once.Do(goRun)
|
once.Do(goRun)
|
||||||
|
|
||||||
shared.watch <- &watchInfo{
|
winfo.fname = filepath.Clean(winfo.fname)
|
||||||
fname: fname,
|
shared.watch <- winfo
|
||||||
}
|
|
||||||
return <-shared.error
|
return <-shared.error
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveWatch signals the run goroutine to remove the watch for the input filename
|
// RemoveWatch signals the run goroutine to remove the watch for the input filename
|
||||||
func RemoveWatch(fname string) {
|
func RemoveWatch(fname string) {
|
||||||
|
remove(&watchInfo{
|
||||||
|
fname: fname,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// RemoveWatch create signals the run goroutine to remove the watch for the input filename
|
||||||
|
func RemoveWatchCreate(fname string) {
|
||||||
|
remove(&watchInfo{
|
||||||
|
op: fsnotify.Create,
|
||||||
|
fname: fname,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func remove(winfo *watchInfo) {
|
||||||
// start running the shared InotifyTracker if not already running
|
// start running the shared InotifyTracker if not already running
|
||||||
once.Do(goRun)
|
once.Do(goRun)
|
||||||
|
|
||||||
|
winfo.fname = filepath.Clean(winfo.fname)
|
||||||
shared.mux.Lock()
|
shared.mux.Lock()
|
||||||
done := shared.done[fname]
|
done := shared.done[winfo.fname]
|
||||||
if done != nil {
|
if done != nil {
|
||||||
delete(shared.done, fname)
|
delete(shared.done, winfo.fname)
|
||||||
close(done)
|
close(done)
|
||||||
}
|
}
|
||||||
shared.mux.Unlock()
|
shared.mux.Unlock()
|
||||||
|
|
||||||
shared.remove <- fname
|
shared.remove <- winfo
|
||||||
}
|
}
|
||||||
|
|
||||||
// Events returns a channel to which FileEvents corresponding to the input filename
|
// Events returns a channel to which FileEvents corresponding to the input filename
|
||||||
|
@ -92,36 +129,84 @@ func Cleanup(fname string) {
|
||||||
|
|
||||||
// watchFlags calls fsnotify.WatchFlags for the input filename and flags, creating
|
// watchFlags calls fsnotify.WatchFlags for the input filename and flags, creating
|
||||||
// a new Watcher if the previous Watcher was closed.
|
// a new Watcher if the previous Watcher was closed.
|
||||||
func (shared *InotifyTracker) addWatch(fname string) error {
|
func (shared *InotifyTracker) addWatch(winfo *watchInfo) error {
|
||||||
shared.mux.Lock()
|
shared.mux.Lock()
|
||||||
defer shared.mux.Unlock()
|
defer shared.mux.Unlock()
|
||||||
|
|
||||||
if shared.chans[fname] == nil {
|
if shared.chans[winfo.fname] == nil {
|
||||||
shared.chans[fname] = make(chan fsnotify.Event)
|
shared.chans[winfo.fname] = make(chan fsnotify.Event)
|
||||||
shared.done[fname] = make(chan bool)
|
shared.done[winfo.fname] = make(chan bool)
|
||||||
}
|
}
|
||||||
return shared.watcher.Add(fname)
|
|
||||||
|
fname := winfo.fname
|
||||||
|
if winfo.isCreate() {
|
||||||
|
// Watch for new files to be created in the parent directory.
|
||||||
|
fname = filepath.Dir(fname)
|
||||||
|
}
|
||||||
|
|
||||||
|
// already in inotify watch
|
||||||
|
if shared.watchNums[fname] > 0 {
|
||||||
|
shared.watchNums[fname]++
|
||||||
|
if winfo.isCreate() {
|
||||||
|
shared.watchNums[winfo.fname]++
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
err := shared.watcher.Add(fname)
|
||||||
|
if err == nil {
|
||||||
|
shared.watchNums[fname]++
|
||||||
|
if winfo.isCreate() {
|
||||||
|
shared.watchNums[winfo.fname]++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// removeWatch calls fsnotify.RemoveWatch for the input filename and closes the
|
// removeWatch calls fsnotify.RemoveWatch for the input filename and closes the
|
||||||
// corresponding events channel.
|
// corresponding events channel.
|
||||||
func (shared *InotifyTracker) removeWatch(fname string) {
|
func (shared *InotifyTracker) removeWatch(winfo *watchInfo) {
|
||||||
shared.mux.Lock()
|
shared.mux.Lock()
|
||||||
defer shared.mux.Unlock()
|
defer shared.mux.Unlock()
|
||||||
|
|
||||||
if ch := shared.chans[fname]; ch != nil {
|
ch := shared.chans[winfo.fname]
|
||||||
shared.watcher.Remove(fname)
|
if ch == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
delete(shared.chans, fname)
|
fname := winfo.fname
|
||||||
|
if winfo.isCreate() {
|
||||||
|
// Watch for new files to be created in the parent directory.
|
||||||
|
fname = filepath.Dir(fname)
|
||||||
|
}
|
||||||
|
|
||||||
|
shared.watchNums[fname]--
|
||||||
|
if shared.watchNums[fname] == 0 {
|
||||||
|
delete(shared.watchNums, fname)
|
||||||
|
// TODO: handle error
|
||||||
|
shared.watcher.Remove(fname)
|
||||||
|
}
|
||||||
|
|
||||||
|
delete(shared.chans, winfo.fname)
|
||||||
close(ch)
|
close(ch)
|
||||||
|
|
||||||
|
if !winfo.isCreate() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
shared.watchNums[winfo.fname]--
|
||||||
|
if shared.watchNums[winfo.fname] == 0 {
|
||||||
|
delete(shared.watchNums, winfo.fname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// sendEvent sends the input event to the appropriate Tail.
|
// sendEvent sends the input event to the appropriate Tail.
|
||||||
func (shared *InotifyTracker) sendEvent(event fsnotify.Event) {
|
func (shared *InotifyTracker) sendEvent(event fsnotify.Event) {
|
||||||
|
name := filepath.Clean(event.Name)
|
||||||
|
|
||||||
shared.mux.Lock()
|
shared.mux.Lock()
|
||||||
ch := shared.chans[event.Name]
|
ch := shared.chans[name]
|
||||||
done := shared.done[event.Name]
|
done := shared.done[name]
|
||||||
shared.mux.Unlock()
|
shared.mux.Unlock()
|
||||||
|
|
||||||
if ch != nil && done != nil {
|
if ch != nil && done != nil {
|
||||||
|
@ -144,10 +229,10 @@ func (shared *InotifyTracker) run() {
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case winfo := <-shared.watch:
|
case winfo := <-shared.watch:
|
||||||
shared.error <- shared.addWatch(winfo.fname)
|
shared.error <- shared.addWatch(winfo)
|
||||||
|
|
||||||
case fname := <-shared.remove:
|
case winfo := <-shared.remove:
|
||||||
shared.removeWatch(fname)
|
shared.removeWatch(winfo)
|
||||||
|
|
||||||
case event, open := <-shared.watcher.Events:
|
case event, open := <-shared.watcher.Events:
|
||||||
if !open {
|
if !open {
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
package watch
|
package watch
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hpcloud/tail/util"
|
|
||||||
"gopkg.in/tomb.v1"
|
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/hpcloud/tail/util"
|
||||||
|
"gopkg.in/tomb.v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PollingFileWatcher polls the file for changes.
|
// PollingFileWatcher polls the file for changes.
|
||||||
|
@ -40,7 +41,12 @@ func (fw *PollingFileWatcher) BlockUntilExists(t *tomb.Tomb) error {
|
||||||
panic("unreachable")
|
panic("unreachable")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fw *PollingFileWatcher) ChangeEvents(t *tomb.Tomb, pos int64) *FileChanges {
|
func (fw *PollingFileWatcher) ChangeEvents(t *tomb.Tomb, pos int64) (*FileChanges, error) {
|
||||||
|
origFi, err := os.Stat(fw.Filename)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
changes := NewFileChanges()
|
changes := NewFileChanges()
|
||||||
var prevModTime time.Time
|
var prevModTime time.Time
|
||||||
|
|
||||||
|
@ -48,11 +54,6 @@ func (fw *PollingFileWatcher) ChangeEvents(t *tomb.Tomb, pos int64) *FileChanges
|
||||||
// the fatal (below) with tomb's Kill.
|
// the fatal (below) with tomb's Kill.
|
||||||
|
|
||||||
fw.Size = pos
|
fw.Size = pos
|
||||||
origFi, err := os.Stat(fw.Filename)
|
|
||||||
if err != nil {
|
|
||||||
changes.NotifyDeleted()
|
|
||||||
return changes
|
|
||||||
}
|
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
defer changes.Close()
|
defer changes.Close()
|
||||||
|
@ -110,7 +111,7 @@ func (fw *PollingFileWatcher) ChangeEvents(t *tomb.Tomb, pos int64) *FileChanges
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return changes
|
return changes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -15,5 +15,5 @@ type FileWatcher interface {
|
||||||
// or truncation event.
|
// or truncation event.
|
||||||
// In order to properly report truncations, ChangeEvents requires
|
// In order to properly report truncations, ChangeEvents requires
|
||||||
// the caller to pass their current offset in the file.
|
// the caller to pass their current offset in the file.
|
||||||
ChangeEvents(*tomb.Tomb, int64) *FileChanges
|
ChangeEvents(*tomb.Tomb, int64) (*FileChanges, error)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue