zgo.at/follow Index | Files | Directories

package follow

import "zgo.at/follow"

Index

Package Files

follow.go

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.

Directories

PathSynopsis
tail
Version
v0.0.0-20221021024812-dd647d64b369 (latest)
Published
Oct 21, 2022
Platform
linux/amd64
Imports
10 packages (graph)
Last checked
1 month ago

Tools for package owners.