openurl

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package openurl provides helpers for URLMux and URLOpeners in portable APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SchemeMap

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

SchemeMap maps URL schemes to values. The zero value is an empty map, ready for use. All schemes are stored and compared case-insensitively.

func (*SchemeMap) FromString

func (m *SchemeMap) FromString(typ, urlstr string) (any, *url.URL, error)

FromString parses urlstr as an URL and looks up the value for the URL's scheme.

func (*SchemeMap) FromURL

func (m *SchemeMap) FromURL(typ string, u *url.URL) (any, error)

FromURL looks up the value for u's scheme.

func (*SchemeMap) Register

func (m *SchemeMap) Register(api, typ, scheme string, value any)

Register registers scheme for value; subsequent calls to FromString or FromURL with scheme will return value. api is the portable API name (e.g., "blob"); the same value should always be passed. It should be in all lowercase. typ is the portable type (e.g., "Bucket"). Register panics if scheme has already been registered.

func (*SchemeMap) Schemes added in v0.13.0

func (m *SchemeMap) Schemes() []string

Schemes returns a sorted slice of the registered schemes.

func (*SchemeMap) ValidScheme added in v0.13.0

func (m *SchemeMap) ValidScheme(scheme string) bool

ValidScheme returns true iff scheme has been registered.

Jump to

Keyboard shortcuts

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