package openurl
import "gocloud.dev/internal/openurl"
Package openurl provides helpers for URLMux and URLOpeners in portable APIs.
Index ¶
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 ¶
FromString parses urlstr as an URL and looks up the value for the URL's scheme.
func (*SchemeMap) FromURL ¶
FromURL looks up the value for u's scheme.
func (*SchemeMap) Register ¶
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 ¶
Schemes returns a sorted slice of the registered schemes.
func (*SchemeMap) ValidScheme ¶
ValidScheme returns true iff scheme has been registered.
Source Files ¶
openurl.go
- Version
- v0.42.0 (latest)
- Published
- Jun 28, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 8 hours ago –
Tools for package owners.