namedpipe

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultMaxLogSize = 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseConfig

type BaseConfig struct {
	Path        string       `mapstructure:"path"`
	Permissions uint32       `mapstructure:"mode"`
	Encoding    string       `mapstructure:"encoding"`
	SplitConfig split.Config `mapstructure:"multiline,omitempty"`
	TrimConfig  trim.Config  `mapstructure:",squash"`
	MaxLogSize  int          `mapstructure:"max_log_size"`
}

type Config

type Config struct {
	helper.InputConfig `mapstructure:",squash"`
	BaseConfig         `mapstructure:",squash"`
}

Config is the configuration of a stdin input operator.

func NewConfig

func NewConfig() *Config

func NewConfigWithID

func NewConfigWithID(operatorID string) *Config

NewConfig creates a new stdin input config with default values

func (*Config) Build

func (c *Config) Build(logger *zap.SugaredLogger) (operator.Operator, error)

Build will build a namedpipe input operator.

type Input

type Input struct {
	helper.InputOperator
	// contains filtered or unexported fields
}

func (*Input) Start

func (i *Input) Start(_ operator.Persister) error

func (*Input) Stop

func (i *Input) Stop() error

type Watcher

type Watcher struct {
	C chan struct{}
	// contains filtered or unexported fields
}

Watcher watches a file for writes, notifying via `C` when one is observed.

func NewWatcher

func NewWatcher(path string) (*Watcher, error)

NewWatcher creates a new watcher for the given path.

func (*Watcher) Watch

func (w *Watcher) Watch(ctx context.Context) error

Watch starts the watcher, sending a message to `C` when a write is observed.

Jump to

Keyboard shortcuts

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