urlrewrite

package
v1.0.98 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package urlrewrite resolves and applies the optional URL rewrite extension.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveProvider

func ResolveProvider(ctx context.Context, provider exttransport.Provider) exttransport.URLRewriter

ResolveProvider resolves the URL rewriter from provider. Providers that do not implement URLRewriterProvider, and providers that return a nil rewriter, resolve to nil. Callers that have already selected a provider should use this function so related extension hooks use the same provider instance.

func Rewrite

func Rewrite(rawURL string) string

Rewrite applies the registered URL rewriter to rawURL, returning rawURL unchanged when no rewriter is registered. Rewriting is a synchronous in-process string mapping; the extension is trusted in-process code and owns the returned value, so URL-consuming call sites apply their existing parsing and transport behavior.

Types

type RequestError

type RequestError interface {
	error
	EffectiveRequestURL() string
}

RequestError exposes the effective, sanitized destination of a failed request. Transport produces it; diagnostic and error output consume it.

Jump to

Keyboard shortcuts

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