config

package
v1.35.5 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogConfigGenerator

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

LogConfigGenerator accumulates pipelines and converts them to the vector config file.

func NewLogConfigGenerator

func NewLogConfigGenerator() *LogConfigGenerator

NewLogConfigGenerator return a new instance of a LogConfigGenerator.

func (*LogConfigGenerator) AppendLogPipeline

func (g *LogConfigGenerator) AppendLogPipeline(pipeline *Pipeline)

AppendLogPipeline adds the pipeline to the accumulated ones. Pipeline always contains a single log source and one or more transform rules / sinks.

func (*LogConfigGenerator) BuildTransforms

func (g *LogConfigGenerator) BuildTransforms(name string, trans []impl.LogTransform) ([]impl.LogTransform, error)

BuildTransforms returns a formatted ordered list off transform rules that should be applied to the pipelines.

func (*LogConfigGenerator) GenerateConfig

func (g *LogConfigGenerator) GenerateConfig() ([]byte, error)

GenerateConfig returns collected pipelines as a JSON formatted document.

type Pipeline

type Pipeline struct {
	Source       impl.LogSource
	Transforms   []impl.LogTransform
	Destinations []impl.LogDestination
}

Pipeline is a representation of a single logical tube.

Example: ClusterLoggingConfig +(destinationRef) ClusterLogsDestination = Single Pipeline.

func NewPipeline

func NewPipeline() *Pipeline

NewPipeline creates an empty pipeline instance.

func NewPipelineCluster

func NewPipelineCluster(generator *LogConfigGenerator, destMap map[string]v1alpha1.ClusterLogDestination, sourceConfig *model.ClusterLoggingConfig) (*Pipeline, error)

NewPipelineCluster creates a new pipeline instance for the cluster scoped ClusterLoggingConfig resource.

func NewPipelineNamespaced

func NewPipelineNamespaced(generator *LogConfigGenerator, destMap map[string]v1alpha1.ClusterLogDestination, sourceConfig *model.PodLoggingConfig) (*Pipeline, error)

NewPipelineNamespaced creates a new pipeline instance for the namespaced PodLoggingConfig resource.

type VectorFile

type VectorFile struct {
	Sources    map[string]impl.LogSource      `json:"sources,omitempty"`
	Transforms map[string]impl.LogTransform   `json:"transforms,omitempty"`
	Sinks      map[string]impl.LogDestination `json:"sinks,omitempty"`
}

VectorFile is a vector config file corresponding golang structure.

func NewVectorFile

func NewVectorFile() *VectorFile

NewVectorFile inits a VectorFile instance.

func (*VectorFile) ConvertToJSON

func (v *VectorFile) ConvertToJSON() ([]byte, error)

ConvertToJSON converts the vector file to the pretty-formatted JSON document.

Jump to

Keyboard shortcuts

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