follow – zgo.at/follow Index | Files | Directories

package follow

import "zgo.at/follow"

Index

Types

type Data

type Data struct {
	Err   error
	Bytes []byte
}

func (Data) String

func (d Data) String() string

type Follower

type Follower struct {
	Data   chan Data      // Data read from the file.
	Ready  chan struct{}  // Closed if everything is set up.
	Reopen chan os.Signal // Send signal to reopen file.

	// Retry opening the file if it disappears for this period; this will
	// attempt to open the file every second.
	//
	// Default is 2s; set to -1 to retry forever.
	Retry time.Duration
	// contains filtered or unexported fields
}

func New

func New() Follower

func (*Follower) Start

func (f *Follower) Start(ctx context.Context, file string) error

Start following a file for changes.

func (Follower) Stop

func (f Follower) Stop()

Stop following a file for changes.

Source Files

follow.go

Directories

PathSynopsis
tail
Version
v0.0.0-20240522232612-673fb184d32f (latest)
Published
May 22, 2024
Platform
linux/amd64
Imports
10 packages
Last checked
2 weeks ago

Tools for package owners.