router

package
v2.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGlobalRouter

func NewGlobalRouter(id string) *params.PluginStore

NewGlobalRouter will create a global router to store routes

Types

type LabelRouter

type LabelRouter struct {
	*RouterCommon `json:"inline,omitempty"`
	// Emit mode. If batch, the plugin will emit events per labels matched. Enum: record, batch.
	// +kubebuilder:validation:Enum:=record;batch
	EmitMode *string `json:"emit_mode,omitempty"`
	// Sticky tags will match only one record from an event stream. The same tag will be treated the same way.
	StickyTags *string `json:"stickyTags,omitempty"`
	// If defined all non-matching record passes to this label.
	DefaultRoute *string `json:"defaultRoute,omitempty"`
	// If defined all non-matching record rewrited to this tag. (Can be used with label simoultanesly)
	DefaultTag *string `json:"defaultTag,omitempty"`
	// Route the log if match with parameters defined
	Routes []*Route `json:"routes,omitempty"`
}

type Route

type Route struct {
	Id string `json:"id,omitempty"`
	// Route the matching record to the given label
	Label *string `json:"label,omitempty"`
	// // Tag the matching record to the given tag
	Tag *string `json:"tag,omitempty"`
	// List of match statements. Repeatable.
	RouteMatches []*RouteMatch `json:"routeMatches,omitempty"`
}

func NewRoute

func NewRoute(id, namespace, name string, matches []*RouteMatch) (*Route, error)

NewRoute will new a route witch the given label, tag , and matches

func (*Route) NewRoutePlugin

func (r *Route) NewRoutePlugin() (*params.PluginStore, error)

NewRoutePlugin will create a route pluginstore for each fluentd config instance

type RouteMatch

type RouteMatch struct {
	// Label definition to match record. Example: app:nginx
	Labels map[string]string `json:"labels,omitempty"`
	// Comma separated list of namespaces. Ignored if left empty.
	Namespaces []string `json:"namespaces,omitempty"`
	// Comma separated list of hosts. Ignored if left empty.
	Hosts []string `json:"hosts,omitempty"`
	// Comma separated list of container names. Ignored if left empty.
	ContainerNames []string `json:"containerNames,omitempty"`
	// Negate the selector meaning to exclude matches
	Negate *bool `json:"negate,omitempty"`
}

type RouterCommon

type RouterCommon struct {
	Type string `json:"type"`
	// The @label parameter is to route the input events to <label> sections
	Label string `json:"label,omitempty"`
}

Jump to

Keyboard shortcuts

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