Documentation ¶
Index ¶
- Variables
- func LoadCertificate(config *CertificateConfig) (*tls.Certificate, error)
- func LoadCertificateAuthorities(CAs []string) (*x509.CertPool, []error)
- func LoadTLSConfig(config *TLSConfig) (*transport.TLSConfig, error)
- func Plugin(name string, f Factory) map[string][]interface{}
- func ReadHostList(cfg *common.Config) ([]string, error)
- func ReadPEMFile(path, passphrase string) ([]byte, error)
- func RegisterType(name string, f Factory)
- type CertificateConfig
- type Client
- type Connectable
- type Factory
- type Group
- type NetworkClient
- type Observer
- type Stats
- type TLSConfig
Constants ¶
This section is empty.
Variables ¶
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") )
var ( // ErrNoConnectionConfigured indicates no configured connections for publishing. ErrNoConnectionConfigured = errors.New("No connection configured") )
Functions ¶
func LoadCertificate ¶
func LoadCertificate(config *CertificateConfig) (*tls.Certificate, error)
func LoadTLSConfig ¶
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 ReadHostList ¶
ReadHostList reads a list of hosts to connect to from an configuration object. If the `workers` settings is > 1, each host is duplicated in the final host list by the number of `workers`.
func ReadPEMFile ¶
func RegisterType ¶
RegisterType registers a new output type.
Types ¶
type CertificateConfig ¶
type Client ¶
type Client interface { Close() error // Publish sends events to the clients sink. A client must synchronously or // asynchronously ACK the given batch, once all events have been processed. // Using Retry/Cancelled a client can return a batch of unprocessed events to // the publisher pipeline. The publisher pipeline (if configured by the output // factory) will take care of retrying/dropping events. Publish(publisher.Batch) error }
Client provides the minimal interface an output must implement to be usable with the publisher pipeline.
func NetworkClients ¶
func NetworkClients(netclients []NetworkClient) []Client
NetworkClients converts a list of NetworkClient instances into []Client.
type Connectable ¶
type Connectable interface { // Connect establishes a connection to the clients sink. // The connection attempt shall report an error if no connection could been // established within the given time interval. A timeout value of 0 == wait // forever. Connect() error }
Connectable is optionally implemented by clients that might be able to close and reconnect dynamically.
type Factory ¶
Factory is used by output plugins to build an output instance
func FindFactory ¶
FindFactory finds an output type its factory if available.
type Group ¶
Group configures and combines multiple clients into load-balanced group of clients being managed by the publisher pipeline.
func Fail ¶
Fail helper can be used by output factories, to create a failure response when loading an output must return an error.
func SuccessNet ¶
func SuccessNet(loadbalance bool, batchSize, retry int, netclients []NetworkClient) (Group, error)
type NetworkClient ¶
type NetworkClient interface { Client Connectable }
NetworkClient defines the required client capabilities for network based outputs, that must be reconnectable.
func NewFailoverClient ¶
func NewFailoverClient(clients []NetworkClient) NetworkClient
NewFailoverClient combines a set of NetworkClients into one NetworkClient instances, with at most one active client. If the active client fails, another client will be used.
func WithBackoff ¶
func WithBackoff(client NetworkClient, init, max time.Duration) NetworkClient
WithBackoff wraps a NetworkClient, adding exponential backoff support to a network client if connection/publishing failed.
type Observer ¶
type Observer interface { NewBatch(int) // report new batch being processed with number of events Acked(int) // report number of acked events Failed(int) // report number of failed events Dropped(int) // report number of dropped events Cancelled(int) // report number of cancelled events WriteError(error) // report an I/O error on write WriteBytes(int) // report number of bytes being written ReadError(error) // report an I/O error on read ReadBytes(int) // report number of bytes being read }
Observer provides an interface used by outputs to report common events on documents/events being published and I/O workload.
func NewNilObserver ¶
func NewNilObserver() Observer
NewNilObserver returns an oberserver implementation, ignoring all events.
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats implements the Observer interface, for collecting metrics on common outputs events.
func NewStats ¶
func NewStats(reg *monitoring.Registry) *Stats
NewStats creates a new Stats instance using a backing monitoring registry. This function will create and register a number of metrics with the registry passed. The registry must not be null.
func (*Stats) Dropped ¶
Dropped updates total number of event drops as reported by the output. Outputs will only report dropped events on fatal errors which lead to the event not being publishabel. For example encoding errors or total event size being bigger then maximum supported event size.
func (*Stats) WriteBytes ¶
WriteBytes updates the total number of bytes written/send by an output.
func (*Stats) WriteError ¶
WriteError increases the write I/O error metrics.
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"` Renegotiation tlsRenegotiationSupport `config:"renegotiation"` }
TLSConfig defines config file options for TLS clients.