file_watcher

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewShuntPipe

func NewShuntPipe(maxConns int, outputTimeout time.Duration) (*shuntPipe, error)

Types

type CompletedConfig

type CompletedConfig struct {
	*Config
	// contains filtered or unexported fields
}

func (*CompletedConfig) NewFileWatcher

func (cc *CompletedConfig) NewFileWatcher(firstOutputCtx context.Context) (*FileWatcher, <-chan []byte, error)

type Config

type Config struct {
	MaxConnections int
	OutputTimeout  time.Duration
}

func NewConfig

func NewConfig() *Config

func (*Config) Complete

func (c *Config) Complete(path string) (*CompletedConfig, error)

type FileWatcher

type FileWatcher struct {
	// contains filtered or unexported fields
}

func (*FileWatcher) IsClosed

func (f *FileWatcher) IsClosed() bool

func (*FileWatcher) Output

func (f *FileWatcher) Output(ctx context.Context) (<-chan []byte, error)

func (*FileWatcher) Start

func (f *FileWatcher) Start() error

func (*FileWatcher) Stop

func (f *FileWatcher) Stop() error

type Pipe

type Pipe interface {
	Close()
	IsClosed() bool
	Input() chan<- []byte
	Output() <-chan []byte
}

func NewPipe

func NewPipe(ctx context.Context) Pipe

func TimeoutPipe

func TimeoutPipe(ctx context.Context, timeout time.Duration) Pipe

type ShuntPipe

type ShuntPipe interface {
	Output(ctx context.Context) (<-chan []byte, error)
	Input() chan<- []byte
	IsClosed() bool
	Start() error
	Close() error
}

type WatcherManager

type WatcherManager struct {
	// contains filtered or unexported fields
}

func NewWatcherManager

func NewWatcherManager(config *Config) *WatcherManager

func (*WatcherManager) StopAll

func (wm *WatcherManager) StopAll() error

func (*WatcherManager) Watch

func (wm *WatcherManager) Watch(ctx context.Context, file string) (<-chan []byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL