hostalias

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostAlias

type HostAlias func(hostname string) (newHostname string)

HostAlias applies host aliasing rules, returning a new hostname (or "" if no aliasing is applied).

var None HostAlias = func(hostname string) string { return "" }

None is the no-op HostAlias.

func Compose

func Compose(base, next HostAlias) HostAlias

func Simple

func Simple(mapping map[string]string) HostAlias

func (HostAlias) Apply

func (f HostAlias) Apply(u *url.URL) error

Apply transforms u in-place using host aliasing rules. Error is returned if an unknown/invalid alias is used.

Jump to

Keyboard shortcuts

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