urlreplacer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMappingNotFound = errors.New("mapping not found")
View Source
var ErrMappingNotSpecified = errors.New("you must specify at least one mapping")
View Source
var ErrSchemeNotMatched = errors.New("scheme in mapping and query not matched")

Functions

This section is empty.

Types

type Replacer

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

func (*Replacer) ToSource

func (r *Replacer) ToSource(rawURL string) (string, error)

func (*Replacer) ToTarget

func (r *Replacer) ToTarget(rawURL string) (string, error)

func (*Replacer) URLToSource

func (r *Replacer) URLToSource(parsedURL *url.URL) (string, error)

func (*Replacer) URLToTarget

func (r *Replacer) URLToTarget(parsedURL *url.URL) (string, error)

type URLReplacerFactory

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

func NewURLReplacerFactory

func NewURLReplacerFactory(mappings map[string]string) (*URLReplacerFactory, error)

func (*URLReplacerFactory) Make

func (f *URLReplacerFactory) Make(requestURL *url.URL) (*Replacer, error)

Jump to

Keyboard shortcuts

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