replace

package
v0.0.0-...-59d4d0b Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Replacement

type Replacement struct {
	Match       string
	Replacement string
}

Replacement is regexp match and replacement strings

func (*Replacement) Replace

func (r *Replacement) Replace(s string) string

Replace replaces s with r.Replacement if s matches r.Match

type Replacements

type Replacements []*Replacement

func NewReplacements

func NewReplacements(data []byte) (Replacements, error)

NewReplacements parses Replacements from a simple yaml key: value list

func NewReplacementsFromFile

func NewReplacementsFromFile(path string) (Replacements, error)

NewReplacements parses Replacements from a file containing a simple yaml key: value list

func (Replacements) Replace

func (r Replacements) Replace(s string) string

Replace processes all replacements on s in order

Jump to

Keyboard shortcuts

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