 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
      Index ¶
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  
    var ( // DefaultLogger is used when Config.Logger == nil DefaultLogger = log.New(os.Stderr, "", log.LstdFlags) // DiscardingLogger can be used to disable logging output DiscardingLogger = log.New(ioutil.Discard, "", 0) )
      View Source
      
  
var (
	ErrStop = fmt.Errorf("tail should now stop")
)
    Functions ¶
Types ¶
type Config ¶
type Config struct {
	// File-specifc
	Location    *SeekInfo // Seek to this location before tailing
	ReOpen      bool      // Reopen recreated files (tail -F)
	MustExist   bool      // Fail early if the file does not exist
	Poll        bool      // Poll for file changes instead of using inotify
	RateLimiter *ratelimiter.LeakyBucket
	// Generic IO
	Follow      bool // Continue looking for new lines (tail -f)
	MaxLineSize int  // If non-zero, split longer lines into multiple lines
	// Logger, when nil, is set to tail.DefaultLogger
	// To disable logging: set field to tail.DiscardingLogger
	Logger *log.Logger
}
    Config is used to specify how a file must be tailed.
type Tail ¶
type Tail struct {
	Filename string
	Lines    chan *Line
	Config
	tomb.Tomb // provides: Done, Kill, Dying
	// contains filtered or unexported fields
}
     Click to show internal directories. 
   Click to hide internal directories.