rewrites

package
v0.0.0-...-ec279c9 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package rewrites provides primitives for working with rewrite rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rewrite

type Rewrite struct {
	From string
	To   string
	Copy bool

	CompiledFrom *regexp.Regexp
	// contains filtered or unexported fields
}

Rewrite is a routing rewrite.

type Rewrites

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

Rewrites represent all the routing rewrites/routing table.

func Build

func Build(crw *conf.Rewrites, measureRegex bool, metrics *metrics.Prom) (Rewrites, error)

Build reads rewrite rules from config, compiles them.

func (Rewrites) RewriteMetricBytes

func (rw Rewrites) RewriteMetricBytes(record *rec.RecBytes, ms *metrics.Prom) ([]*rec.RecBytes, error)

RewriteMetricBytes executes all rewrite rules on a record. If copy is true and rule matches, we generate new record.

Jump to

Keyboard shortcuts

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