rewriter

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: BSD-2-Clause-Views Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RW

type RW struct {
	Old string `json:"old"`
	New string `json:"new"`
	Not string `json:"not"`
	Max int    `json:"max"`
	// contains filtered or unexported fields
}

RW is a rewriter

func New

func New(old, new, not string, max int) (RW, error)

NewFromByte creates a rewriter that will rewrite old to new, up to max times for regex, max must be -1

func (RW) Do

func (r RW) Do(buf []byte) []byte

Do executes the rewriting of the metric line note: it allocates a new one, it would be better to replace in place.

Jump to

Keyboard shortcuts

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