middleware

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RewriteHandler

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

func NewRewriteHandler

func NewRewriteHandler(rules []string) *RewriteHandler

func (*RewriteHandler) ApplyRules

func (h *RewriteHandler) ApplyRules(from string) (bool, string)

type RewriteOptions

type RewriteOptions struct {
	Rewrites []string `name:"rewrites" desc:"An ordered list of rewrite rules, eg. ':key::/new/:key/path'."`
}

type Rule

type Rule struct {
	Pattern string
	To      string
	*regexp.Regexp
}

func NewRule

func NewRule(pattern, to string) (*Rule, error)

func (*Rule) Replace

func (r *Rule) Replace(from string) string

func (*Rule) Rewrite

func (r *Rule) Rewrite(from string) (bool, string)

Jump to

Keyboard shortcuts

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