urlreplacer

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 5 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) IsSourceSecure added in v0.0.3

func (r *Replacer) IsSourceSecure() bool

func (*Replacer) IsTargetSecure added in v0.0.3

func (r *Replacer) IsTargetSecure() bool

func (*Replacer) StringToSource added in v0.0.3

func (r *Replacer) StringToSource(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) (*url.URL, error)

func (*Replacer) URLToTarget

func (r *Replacer) URLToTarget(parsedURL *url.URL) (*url.URL, 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