ns

package
v0.0.0-...-f9c6b4f Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Escape

func Escape(in string) string

Escape escapes instances of '\' and '*' with a backslash

func Unescape

func Unescape(in string) string

Unescape removes the escaping backslash where applicable

Types

type Matcher

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

Matcher identifies namespaces given user-defined patterns

func NewMatcher

func NewMatcher(patterns []string) (m *Matcher, err error)

NewMatcher creates a matcher that will use the given list patterns to match namespaces

func (*Matcher) Has

func (m *Matcher) Has(name string) bool

Has returns whether the given namespace matches any of the matcher's patterns

type Renamer

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

Renamer maps namespaces given user-defined patterns

func NewRenamer

func NewRenamer(fromSlice, toSlice []string) (r *Renamer, err error)

NewRenamer creates a Renamer that will use the given from and to slices to map namespaces

func (*Renamer) Get

func (r *Renamer) Get(name string) string

Get returns the rewritten namespace according to the renamer's rules

Jump to

Keyboard shortcuts

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