rewriter

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 1 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rewriter

type Rewriter struct {
	From string `yaml:"from" json:"from"`
	To   string `yaml:"to" json:"to"`
}

Rewriter is a rewrite rule.

func (*Rewriter) IsMatch

func (r *Rewriter) IsMatch(path string) bool

IsMatch returns true if the path matches the rule.

func (*Rewriter) Rewrite

func (r *Rewriter) Rewrite(path string) string

Rewrite rewrites the path.

type Rewriters

type Rewriters []Rewriter

Rewriters is a list of rewrite rules.

func (*Rewriters) Add added in v1.4.1

func (r *Rewriters) Add(from, to string)

Add adds a rewrite rule.

func (*Rewriters) Rewrite

func (r *Rewriters) Rewrite(path string) string

Rewrite rewrites the path.

Jump to

Keyboard shortcuts

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