Documentation ¶
Index ¶
- Constants
- func CloseSequentially(a, b io.Closer) error
- type Config
- type Context
- type FlowConfig
- type InputFormat
- type InputFormatCtor
- type InputModifier
- type InputModifierCtor
- type InputModifiers
- type InputReader
- type Meta
- type Middleware
- type OutputFormat
- type OutputFormatCtor
- type OutputModifier
- type OutputModifierCtor
- type OutputModifiers
- type OutputWriter
- type Sink
- type SinkCtor
- type Source
- type SourceCtor
Constants ¶
const (
// LoggerKeyComponent is the logger key for components.
LoggerKeyComponent = "component"
)
Variables ¶
This section is empty.
Functions ¶
func CloseSequentially ¶
CloseSequentially closes a and if there is no error, closes b.
Types ¶
type Config ¶
type Config struct { PrometheusAddr string Debug bool DebugPackets bool DebugHTTPMessages bool ProfilePathCPU string ProfilePathMemory string ProfileHTTPAddr string Plugin string }
Config is a general config.
type Context ¶
type Context struct { Config *Config FlowConfig *FlowConfig SessionID string StdContext context.Context Cancel context.CancelFunc Errors chan error Logger zerolog.Logger Registry *envelope.Registry }
Context is a context for a session.
func NewContext ¶
func NewContext(cfg *Config, flowCfg *FlowConfig, errs chan error) Context
NewContext creates a new context.
func NewContextForWriter ¶
NewContextForWriter creates a new context with logs written to a specific writer.
type FlowConfig ¶
type FlowConfig struct { SourceDuration time.Duration InputDrainDuration time.Duration Addr string AddrSink string CaptureResponse bool Middleware string HTTPTimeout time.Duration TCPTimeout time.Duration BufferOutput bool GCSBucketName string GCSObjectName string InputFile string S3CompatEndpoint string S3CompatAccessKey string S3CompatSecretKey string S3CompatToken string S3CompatSecure bool S3CompatBucketName string S3CompatObjectName string }
FlowConfig is a Flow config.
type InputFormat ¶
type InputFormat interface { Init(Context, Middleware, <-chan InputReader) Out() <-chan interface{} }
InputFormat is an interface for formatting input.
type InputFormatCtor ¶
type InputFormatCtor func(Context) (InputFormat, error)
InputFormatCtor is a map of string to input format constructors.
type InputModifier ¶
type InputModifier interface {
Wrap(InputReader) (InputReader, error)
}
InputModifier wraps an InputReader.
type InputModifierCtor ¶
type InputModifierCtor func(Context) (InputModifier, error)
InputModifierCtor is a map of string to input modifier constructors.
type InputModifiers ¶
type InputModifiers []InputModifier
InputModifiers is a slice of InputModifier.
func (InputModifiers) Wrap ¶
func (is InputModifiers) Wrap(r InputReader) (InputReader, error)
Wrap wraps an InputReader in all modifiers.
type InputReader ¶
type InputReader interface { io.ReadCloser Meta() *Meta }
InputReader is an input reader.
func EmptyMeta ¶
func EmptyMeta(r io.ReadCloser) InputReader
EmptyMeta wraps an io.ReadCloser with an empty Meta.
type Meta ¶
type Meta struct { SourceID string // contains filtered or unexported fields }
Meta is a map of flow-related metadata.
type Middleware ¶
type Middleware interface { Start() error Wait() error Close() Exec(Context, []byte, interface{}) (interface{}, error) }
Middleware is an interface that can modify objects.
func NewMiddleware ¶
func NewMiddleware(ctx Context, command string) (Middleware, error)
NewMiddleware creates a new Middleware.
type OutputFormat ¶
type OutputFormat interface { Init(Context, io.Writer) In() chan<- interface{} Complete() <-chan struct{} }
OutputFormat is an interface for formatting output
type OutputFormatCtor ¶
type OutputFormatCtor func(Context) (OutputFormat, error)
OutputFormatCtor is a map of string to output format constructors.
type OutputModifier ¶
type OutputModifier interface {
Wrap(OutputWriter) (OutputWriter, error)
}
OutputModifier wraps an OtputWriter.
type OutputModifierCtor ¶
type OutputModifierCtor func(Context) (OutputModifier, error)
OutputModifierCtor is a map of string to output modifier constructors.
type OutputModifiers ¶
type OutputModifiers []OutputModifier
OutputModifiers is a slice of OutputModifier.
func (OutputModifiers) Wrap ¶
func (os OutputModifiers) Wrap(w OutputWriter) (OutputWriter, error)
Wrap wraps an OutputWrtier in all modifiers.
type OutputWriter ¶
type OutputWriter interface { io.WriteCloser }
OutputWriter is an output writer.
type Source ¶
type Source interface { Init(Context) Streams() <-chan InputReader }
Source is a data source that can be consumed by an input pipe.
type SourceCtor ¶
SourceCtor is a map of string to source constructors.