Documentation ¶
Overview ¶
Package openurl provides helpers for URLMux and URLOpeners in portable APIs.
Index ¶
- type SchemeMap
- func (m *SchemeMap) FromString(typ, urlstr string) (interface{}, *url.URL, error)
- func (m *SchemeMap) FromURL(typ string, u *url.URL) (interface{}, error)
- func (m *SchemeMap) Register(api, typ, scheme string, value interface{})
- func (m *SchemeMap) Schemes() []string
- func (m *SchemeMap) ValidScheme(scheme string) bool
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.
func (*SchemeMap) FromString ¶
FromString parses urlstr as an URL and looks up the value for the URL'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) ValidScheme ¶
ValidScheme returns true if scheme has been registered.
Click to show internal directories.
Click to hide internal directories.