fluentd

package
v0.0.0-...-c6c896d Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

package fluentd provides a fluentd receiver for use in e2e forwarding tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Receiver

type Receiver struct {
	Name      string
	Sources   map[string]*Source
	Pod       *corev1.Pod
	ConfigMap *corev1.ConfigMap
	// contains filtered or unexported fields
}

Receiver is a service running fluentd, listening on on one or more source ports.

func NewReceiver

func NewReceiver(ns, name string) *Receiver

NewReceiver returns a receiver with no sources. Use AddSource() before calling Create().

func (*Receiver) AddSource

func (r *Receiver) AddSource(s *Source)

func (*Receiver) ConfigPath

func (r *Receiver) ConfigPath(path ...string) string

ConfigPath returns a path relative to the configuration dir.

func (*Receiver) Create

func (r *Receiver) Create(c *client.Client) error

Create the receiver's resources. Blocks till created.

func (*Receiver) Host

func (r *Receiver) Host() string

Host name for the receiver.

type Source

type Source struct {
	// Name for the source in the Receiver's Source map, must be unique per receiver.
	Name string
	// Type is the Fluentd source @type parameter, normally "forward".
	Type string
	// Port is the listening port for this source.
	Port int
	// Cert enables sources as TLS servers.
	Cert *certificate.CertKey
	// CA enables client verification using this CA.
	CA *certificate.CertKey
	// SharedKey enables fluentd's shared_key authentication.
	SharedKey string
	// contains filtered or unexported fields
}

Source represents a fluentd listening port and output file.

func (*Source) HasOutput

func (s *Source) HasOutput() (bool, error)

HasOutput returns true if the source's output file exists and is non empty.

func (*Source) Host

func (s *Source) Host() string

Host is the host name of the receiver service.

func (*Source) OutFile

func (s *Source) OutFile() string

OutFile is the path of the output file for this source on the fluentd Pod.

func (*Source) TailReader

func (s *Source) TailReader() *cmd.Reader

TailReader returns a CmdReader that tails the source's log stream. Will fail if called before Receiver.Create() has returned.

It waits for the file to exist, and will tail the output file forever, so it won't normally return io.EOF.

Jump to

Keyboard shortcuts

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