outputs

package
v0.0.0-...-bc1b659 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotACertificate indicates a PEM file to be loaded not being a valid
	// PEM file or certificate.
	ErrNotACertificate = errors.New("file is not a certificate")

	// ErrCertificateNoKey indicate a configuration error with missing key file
	ErrCertificateNoKey = errors.New("key file not configured")

	// ErrKeyNoCertificate indicate a configuration error with missing certificate file
	ErrKeyNoCertificate = errors.New("certificate file not configured")
)

Functions

func LoadTLSConfig

func LoadTLSConfig(config *TLSConfig) (*transport.TLSConfig, error)

LoadTLSConfig will load a certificate from config with all TLS based keys defined. If Certificate and CertificateKey are configured, client authentication will be configured. If no CAs are configured, the host CA will be used by go built-in TLS support.

func RegisterOutputPlugin

func RegisterOutputPlugin(name string, builder OutputBuilder)

Types

type BulkOutputer

type BulkOutputer interface {
	Outputer
	BulkPublish(sig op.Signaler, opts Options, data []Data) error
}

BulkOutputer adds BulkPublish to publish batches of events without looping. Outputers still might loop on events or use more efficient bulk-apis if present.

func CastBulkOutputer

func CastBulkOutputer(out Outputer) BulkOutputer

CastBulkOutputer casts out into a BulkOutputer if out implements the BulkOutputer interface. If out does not implement the interface an outputer wrapper implementing the BulkOutputer interface is returned.

type CertificateConfig

type CertificateConfig struct {
	Certificate string `config:"certificate"`
	Key         string `config:"key"`
	Passphrase  string `config:"key_passphrase"`
}

type Data

type Data struct {
	// Holds the beats published event and MUST be used read-only manner only in
	// output plugins.
	Event common.MapStr

	// `Values` can be used to store additional context-dependent metadata
	// within Data. With `Data` being copied to each output, it is safe to update
	// `Data.Values` itself in outputs, but access to actually stored values must
	// be thread-safe: read-only if key might be shared or read/write if value key
	// is local to output plugin.
	Values *Values
}

Data contains the Event and additional values shared/populated by outputs to share state internally in output plugins for example between retries.

Values of type Data are pushed by value inside the publisher chain up to the outputs. If multiple outputs are configured, each will receive a copy of Data elemets.

func (*Data) AddValue

func (d *Data) AddValue(key, value interface{})

type Options

type Options struct {
	Guaranteed bool
}

type OutputBuilder

type OutputBuilder func(beatName string, config *common.Config, topologyExpire int) (Outputer, error)

Create and initialize the output plugin

func FindOutputPlugin

func FindOutputPlugin(name string) OutputBuilder

type OutputInterface

type OutputInterface interface {
	Outputer
	TopologyOutputer
}

Functions to be exported by a output plugin

type OutputPlugin

type OutputPlugin struct {
	Name   string
	Config *common.Config
	Output Outputer
}

func InitOutputs

func InitOutputs(
	beatName string,
	configs map[string]*common.Config,
	topologyExpire int,
) ([]OutputPlugin, error)

type Outputer

type Outputer interface {
	// Publish event
	PublishEvent(sig op.Signaler, opts Options, data Data) error

	Close() error
}

type TLSConfig

type TLSConfig struct {
	Enabled          *bool                         `config:"enabled"`
	VerificationMode transport.TLSVerificationMode `config:"verification_mode"` // one of 'none', 'full'
	Versions         []transport.TLSVersion        `config:"supported_protocols"`
	CipherSuites     []tlsCipherSuite              `config:"cipher_suites"`
	CAs              []string                      `config:"certificate_authorities"`
	Certificate      CertificateConfig             `config:",inline"`
	CurveTypes       []tlsCurveType                `config:"curve_types"`
}

TLSConfig defines config file options for TLS clients.

func (*TLSConfig) IsEnabled

func (c *TLSConfig) IsEnabled() bool

func (*TLSConfig) Validate

func (c *TLSConfig) Validate() error

type TopologyOutputer

type TopologyOutputer interface {
	// Register the agent name and its IPs to the topology map
	PublishIPs(name string, localAddrs []string) error

	// Get the agent name with a specific IP from the topology map
	GetNameByIP(ip string) string
}

type Values

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

Values is a recursive key/value store for use by output plugins and publisher pipeline to share context-dependent values.

func ValueWith

func ValueWith(parent *Values, key interface{}, value interface{}) *Values

ValueWith creates new key/value store shadowing potentially old keys.

func (*Values) Append

func (v *Values) Append(key, value interface{}) *Values

Append creates new key/value store from existing store by adding a new key/value pair potentially shadowing an already present key/value pair.

func (*Values) Get

func (v *Values) Get(key interface{}) (interface{}, bool)

Get retrieves a value for the given key.

func (*Values) IsEmpty

func (v *Values) IsEmpty() bool

IsEmpty returns true if key/value store is empty.

Directories

Path Synopsis
Package mode defines and implents output strategies with failover or load balancing modes for use by output plugins.
Package mode defines and implents output strategies with failover or load balancing modes for use by output plugins.
lb

Jump to

Keyboard shortcuts

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