Documentation ¶
Index ¶
- Variables
- func LoadTLSConfig(config *TLSConfig) (*transport.TLSConfig, error)
- func Plugin(name string, f Factory) map[string][]interface{}
- func ReadHostList(cfg *common.Config) ([]string, error)
- func RegisterType(name string, f Factory)
- type CertificateConfig
- type Client
- type Connectable
- type Factory
- type Group
- type NetworkClient
- 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 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 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 capabilites 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 Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats provides a common type used by outputs to report common events. The output events will update a set of unified output metrics in the underlying monitoring.Registry.
func MakeStats ¶
func MakeStats(reg *monitoring.Registry) Stats
func (*Stats) WriteBytes ¶
func (*Stats) WriteError ¶
func (s *Stats) WriteError()
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.