url

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct {
	// Scheme modification
	Scheme string `cfg:"scheme"`

	// Host modification
	Host string `cfg:"host"`

	// Path modifications
	Path        string `cfg:"path"`
	PathPrefix  string `cfg:"path_prefix"`
	PathSuffix  string `cfg:"path_suffix"`
	StripPrefix string `cfg:"strip_prefix"`

	// Path replacement with regex
	PathReplace     string `cfg:"path_replace"`
	PathReplaceWith string `cfg:"path_replace_with"`

	// Query parameter modifications
	AddQuery    map[string]string `cfg:"add_query"`
	RemoveQuery []string          `cfg:"remove_query"`
	SetQuery    map[string]string `cfg:"set_query"`

	// Fragment modification
	Fragment string `cfg:"fragment"`

	// Port modification
	Port string `cfg:"port"`
	// contains filtered or unexported fields
}

type RuleCheck

type RuleCheck struct {
	AlwaysMatch bool     `cfg:"always_match"`
	HostMatch   []string `cfg:"host_match"`
	PathMatch   []string `cfg:"path_match"`

	Modify Rule `cfg:"modify"`
}

type SchemeModify

type SchemeModify struct {
	Scheme     string `cfg:"scheme"`
	HostSuffix string `cfg:"host_suffix"`
}

type URL

type URL struct {
	Rules []RuleCheck `cfg:"rules"`
}

func (*URL) Middleware

func (m *URL) Middleware() (func(http.Handler) http.Handler, error)

Jump to

Keyboard shortcuts

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