package url
Import Path
net/url (on go.dev )
Dependency Relation
imports 9 packages , and imported by 77 packages
Code Examples
ParseQuery
package main
import (
"encoding/json"
"fmt"
"log"
"net/url"
"strings"
)
func main() {
m, err := url.ParseQuery(`x=1&y=2&y=3`)
if err != nil {
log.Fatal(err)
}
fmt.Println(toJSON(m))
}
func toJSON(m any) string {
js, err := json.Marshal(m)
if err != nil {
log.Fatal(err)
}
return strings.ReplaceAll(string(js), ",", ", ")
}
PathEscape
package main
import (
"fmt"
"net/url"
)
func main() {
path := url.PathEscape("my/cool+blog&about,stuff")
fmt.Println(path)
}
PathUnescape
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
escapedPath := "my%2Fcool+blog&about%2Cstuff"
path, err := url.PathUnescape(escapedPath)
if err != nil {
log.Fatal(err)
}
fmt.Println(path)
}
QueryEscape
package main
import (
"fmt"
"net/url"
)
func main() {
query := url.QueryEscape("my/cool+blog&about,stuff")
fmt.Println(query)
}
QueryUnescape
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
escapedQuery := "my%2Fcool%2Bblog%26about%2Cstuff"
query, err := url.QueryUnescape(escapedQuery)
if err != nil {
log.Fatal(err)
}
fmt.Println(query)
}
URL
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("http://bing.com/search?q=dotnet")
if err != nil {
log.Fatal(err)
}
u.Scheme = "https"
u.Host = "google.com"
q := u.Query()
q.Set("q", "golang")
u.RawQuery = q.Encode()
fmt.Println(u)
}
URL_EscapedFragment
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("http://example.com/#x/y%2Fz")
if err != nil {
log.Fatal(err)
}
fmt.Println("Fragment:", u.Fragment)
fmt.Println("RawFragment:", u.RawFragment)
fmt.Println("EscapedFragment:", u.EscapedFragment())
}
URL_EscapedPath
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("http://example.com/x/y%2Fz")
if err != nil {
log.Fatal(err)
}
fmt.Println("Path:", u.Path)
fmt.Println("RawPath:", u.RawPath)
fmt.Println("EscapedPath:", u.EscapedPath())
}
URL_Hostname
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("https://example.org:8000/path")
if err != nil {
log.Fatal(err)
}
fmt.Println(u.Hostname())
u, err = url.Parse("https://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:17000")
if err != nil {
log.Fatal(err)
}
fmt.Println(u.Hostname())
}
URL_IsAbs
package main
import (
"fmt"
"net/url"
)
func main() {
u := url.URL{Host: "example.com", Path: "foo"}
fmt.Println(u.IsAbs())
u.Scheme = "http"
fmt.Println(u.IsAbs())
}
URL_JoinPath
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("https://example.com/foo/bar")
if err != nil {
log.Fatal(err)
}
fmt.Println(u.JoinPath("baz", "qux"))
}
URL_MarshalBinary
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, _ := url.Parse("https://example.org")
b, err := u.MarshalBinary()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", b)
}
URL_Parse
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("https://example.org")
if err != nil {
log.Fatal(err)
}
rel, err := u.Parse("/foo")
if err != nil {
log.Fatal(err)
}
fmt.Println(rel)
_, err = u.Parse(":foo")
if _, ok := err.(*url.Error); !ok {
log.Fatal(err)
}
}
URL_Port
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("https://example.org")
if err != nil {
log.Fatal(err)
}
fmt.Println(u.Port())
u, err = url.Parse("https://example.org:8080")
if err != nil {
log.Fatal(err)
}
fmt.Println(u.Port())
}
URL_Query
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("https://example.org/?a=1&a=2&b=&=3&&&&")
if err != nil {
log.Fatal(err)
}
q := u.Query()
fmt.Println(q["a"])
fmt.Println(q.Get("b"))
fmt.Println(q.Get(""))
}
URL_Redacted
package main
import (
"fmt"
"net/url"
)
func main() {
u := &url.URL{
Scheme: "https",
User: url.UserPassword("user", "password"),
Host: "example.com",
Path: "foo/bar",
}
fmt.Println(u.Redacted())
u.User = url.UserPassword("me", "newerPassword")
fmt.Println(u.Redacted())
}
URL_RequestURI
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("https://example.org/path?foo=bar")
if err != nil {
log.Fatal(err)
}
fmt.Println(u.RequestURI())
}
URL_ResolveReference
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u, err := url.Parse("../../..//search?q=dotnet")
if err != nil {
log.Fatal(err)
}
base, err := url.Parse("http://example.com/directory/")
if err != nil {
log.Fatal(err)
}
fmt.Println(base.ResolveReference(u))
}
URL_String
package main
import (
"fmt"
"net/url"
)
func main() {
u := &url.URL{
Scheme: "https",
User: url.UserPassword("me", "pass"),
Host: "example.com",
Path: "foo/bar",
RawQuery: "x=1&y=2",
Fragment: "anchor",
}
fmt.Println(u.String())
u.Opaque = "opaque"
fmt.Println(u.String())
}
URL_UnmarshalBinary
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
u := &url.URL{}
err := u.UnmarshalBinary([]byte("https://example.org/foo"))
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", u)
}
URL_roundtrip
package main
import (
"fmt"
"log"
"net/url"
)
func main() {
// Parse + String preserve the original encoding.
u, err := url.Parse("https://example.com/foo%2fbar")
if err != nil {
log.Fatal(err)
}
fmt.Println(u.Path)
fmt.Println(u.RawPath)
fmt.Println(u.String())
}
Values
package main
import (
"fmt"
"net/url"
)
func main() {
v := url.Values{}
v.Set("name", "Ava")
v.Add("friend", "Jess")
v.Add("friend", "Sarah")
v.Add("friend", "Zoe")
// v.Encode() == "name=Ava&friend=Jess&friend=Sarah&friend=Zoe"
fmt.Println(v.Get("name"))
fmt.Println(v.Get("friend"))
fmt.Println(v["friend"])
}
Values_Add
package main
import (
"fmt"
"net/url"
)
func main() {
v := url.Values{}
v.Add("cat sounds", "meow")
v.Add("cat sounds", "mew")
v.Add("cat sounds", "mau")
fmt.Println(v["cat sounds"])
}
Values_Del
package main
import (
"fmt"
"net/url"
)
func main() {
v := url.Values{}
v.Add("cat sounds", "meow")
v.Add("cat sounds", "mew")
v.Add("cat sounds", "mau")
fmt.Println(v["cat sounds"])
v.Del("cat sounds")
fmt.Println(v["cat sounds"])
}
Values_Encode
package main
import (
"fmt"
"net/url"
)
func main() {
v := url.Values{}
v.Add("cat sounds", "meow")
v.Add("cat sounds", "mew/")
v.Add("cat sounds", "mau$")
fmt.Println(v.Encode())
}
Values_Get
package main
import (
"fmt"
"net/url"
)
func main() {
v := url.Values{}
v.Add("cat sounds", "meow")
v.Add("cat sounds", "mew")
v.Add("cat sounds", "mau")
fmt.Printf("%q\n", v.Get("cat sounds"))
fmt.Printf("%q\n", v.Get("dog sounds"))
}
Values_Has
package main
import (
"fmt"
"net/url"
)
func main() {
v := url.Values{}
v.Add("cat sounds", "meow")
v.Add("cat sounds", "mew")
v.Add("cat sounds", "mau")
fmt.Println(v.Has("cat sounds"))
fmt.Println(v.Has("dog sounds"))
}
Values_Set
package main
import (
"fmt"
"net/url"
)
func main() {
v := url.Values{}
v.Add("cat sounds", "meow")
v.Add("cat sounds", "mew")
v.Add("cat sounds", "mau")
fmt.Println(v["cat sounds"])
v.Set("cat sounds", "meow")
fmt.Println(v["cat sounds"])
}
Package-Level Type Names (total 6)
/* sort by: alphabet | popularity */
type URL (struct)
A URL represents a parsed URL (technically, a URI reference).
The general form represented is:
[scheme:][//[userinfo@]host][/]path[?query][#fragment]
URLs that do not start with a slash after the scheme are interpreted as:
scheme:opaque[?query][#fragment]
The Host field contains the host and port subcomponents of the URL.
When the port is present, it is separated from the host with a colon.
When the host is an IPv6 address, it must be enclosed in square brackets:
"[fe80::1]:80". The [net.JoinHostPort] function combines a host and port
into a string suitable for the Host field, adding square brackets to
the host when necessary.
Note that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.
A consequence is that it is impossible to tell which slashes in the Path were
slashes in the raw URL and which were %2f. This distinction is rarely important,
but when it is, the code should use the [URL.EscapedPath] method, which preserves
the original encoding of Path.
The RawPath field is an optional field which is only set when the default
encoding of Path is different from the escaped path. See the EscapedPath method
for more details.
URL's String method uses the EscapedPath method to obtain the path.
Fields (total 11 )
ForceQuery bool
// append a query ('?') even if RawQuery is empty
Fragment string
// fragment for references, without '#'
Host string
// host or host:port (see Hostname and Port methods)
OmitHost bool
// do not emit empty host (authority)
Opaque string
// encoded opaque data
Path string
// path (relative paths may omit leading slash)
RawFragment string
// encoded fragment hint (see EscapedFragment method)
RawPath string
// encoded path hint (see EscapedPath method)
RawQuery string
// encoded query values, without '?'
Scheme string
User *Userinfo
// username and password information
Methods (total 15 )
(*URL) AppendBinary (b []byte ) ([]byte , error )
(*URL) EscapedFragment () string
EscapedFragment returns the escaped form of u.Fragment.
In general there are multiple possible escaped forms of any fragment.
EscapedFragment returns u.RawFragment when it is a valid escaping of u.Fragment.
Otherwise EscapedFragment ignores u.RawFragment and computes an escaped
form on its own.
The [URL.String] method uses EscapedFragment to construct its result.
In general, code should call EscapedFragment instead of
reading u.RawFragment directly.
(*URL) EscapedPath () string
EscapedPath returns the escaped form of u.Path.
In general there are multiple possible escaped forms of any path.
EscapedPath returns u.RawPath when it is a valid escaping of u.Path.
Otherwise EscapedPath ignores u.RawPath and computes an escaped
form on its own.
The [URL.String] and [URL.RequestURI] methods use EscapedPath to construct
their results.
In general, code should call EscapedPath instead of
reading u.RawPath directly.
(*URL) Hostname () string
Hostname returns u.Host, stripping any valid port number if present.
If the result is enclosed in square brackets, as literal IPv6 addresses are,
the square brackets are removed from the result.
(*URL) IsAbs () bool
IsAbs reports whether the [URL] is absolute.
Absolute means that it has a non-empty scheme.
(*URL) JoinPath (elem ...string ) *URL
JoinPath returns a new [URL] with the provided path elements joined to
any existing path and the resulting path cleaned of any ./ or ../ elements.
Any sequences of multiple / characters will be reduced to a single /.
(*URL) MarshalBinary () (text []byte , err error )
(*URL) Parse (ref string ) (*URL , error )
Parse parses a [URL] in the context of the receiver. The provided URL
may be relative or absolute. Parse returns nil, err on parse
failure, otherwise its return value is the same as [URL.ResolveReference] .
(*URL) Port () string
Port returns the port part of u.Host, without the leading colon.
If u.Host doesn't contain a valid numeric port, Port returns an empty string.
(*URL) Query () Values
Query parses RawQuery and returns the corresponding values.
It silently discards malformed value pairs.
To check errors use [ParseQuery] .
(*URL) Redacted () string
Redacted is like [URL.String] but replaces any password with "xxxxx".
Only the password in u.User is redacted.
(*URL) RequestURI () string
RequestURI returns the encoded path?query or opaque?query
string that would be used in an HTTP request for u.
(*URL) ResolveReference (ref *URL ) *URL
ResolveReference resolves a URI reference to an absolute URI from
an absolute base URI u, per RFC 3986 Section 5.2. The URI reference
may be relative or absolute. ResolveReference always returns a new
[URL] instance, even if the returned URL is identical to either the
base or reference. If ref is an absolute URL, then ResolveReference
ignores base and returns a copy of ref.
(*URL) String () string
String reassembles the [URL] into a valid URL string.
The general form of the result is one of:
scheme:opaque?query#fragment
scheme://userinfo@host/path?query#fragment
If u.Opaque is non-empty, String uses the first form;
otherwise it uses the second form.
Any non-ASCII characters in host are escaped.
To obtain the path, String uses u.EscapedPath().
In the second form, the following rules apply:
- if u.Scheme is empty, scheme: is omitted.
- if u.User is nil, userinfo@ is omitted.
- if u.Host is empty, host/ is omitted.
- if u.Scheme and u.Host are empty and u.User is nil,
the entire scheme://userinfo@host/ is omitted.
- if u.Host is non-empty and u.Path begins with a /,
the form host/path does not add its own /.
- if u.RawQuery is empty, ?query is omitted.
- if u.Fragment is empty, #fragment is omitted.
(*URL) UnmarshalBinary (text []byte ) error
Implements (at least 5 )
*URL : encoding.BinaryAppender
*URL : encoding.BinaryMarshaler
*URL : encoding.BinaryUnmarshaler
*URL : expvar.Var
*URL : fmt.Stringer
As Outputs Of (at least 16 )
func Parse (rawURL string ) (*URL , error )
func ParseRequestURI (rawURL string ) (*URL , error )
func (*URL).JoinPath (elem ...string ) *URL
func (*URL).Parse (ref string ) (*URL , error )
func (*URL).ResolveReference (ref *URL ) *URL
func net/http.ProxyFromEnvironment (req *http .Request ) (*URL , error )
func net/http.(*Response ).Location () (*URL , error )
func github.com/dop251/goja/file.ResolveSourcemapURL (basename, source string ) *URL
func github.com/google/go-github/v66/github.(*ActionsService ).DownloadArtifact (ctx context .Context , owner, repo string , artifactID int64 , maxRedirects int ) (*URL , *github .Response , error )
func github.com/google/go-github/v66/github.(*ActionsService ).GetWorkflowJobLogs (ctx context .Context , owner, repo string , jobID int64 , maxRedirects int ) (*URL , *github .Response , error )
func github.com/google/go-github/v66/github.(*ActionsService ).GetWorkflowRunAttemptLogs (ctx context .Context , owner, repo string , runID int64 , attemptNumber int , maxRedirects int ) (*URL , *github .Response , error )
func github.com/google/go-github/v66/github.(*ActionsService ).GetWorkflowRunLogs (ctx context .Context , owner, repo string , runID int64 , maxRedirects int ) (*URL , *github .Response , error )
func github.com/google/go-github/v66/github.(*RepositoriesService ).GetArchiveLink (ctx context .Context , owner, repo string , archiveformat github .ArchiveFormat , opts *github .RepositoryContentGetOptions , maxRedirects int ) (*URL , *github .Response , error )
func github.com/huin/goupnp/soap.UnmarshalURI (s string ) (*URL , error )
func google.golang.org/grpc/internal/credentials.SPIFFEIDFromCert (cert *x509 .Certificate ) *URL
func google.golang.org/grpc/internal/credentials.SPIFFEIDFromState (state tls .ConnectionState ) *URL
As Inputs Of (at least 84 )
func (*URL).ResolveReference (ref *URL ) *URL
func net/http.ProxyURL (fixedURL *URL ) func(*http .Request ) (*URL , error )
func net/http.CookieJar .Cookies (u *URL ) []*http .Cookie
func net/http.CookieJar .SetCookies (u *URL , cookies []*http .Cookie )
func net/http/httputil.NewSingleHostReverseProxy (target *URL ) *httputil .ReverseProxy
func net/http/httputil.(*ProxyRequest ).SetURL (target *URL )
func github.com/gobwas/ws.Dialer .Upgrade (conn io .ReadWriter , u *URL ) (br *bufio .Reader , hs ws .Handshake , err error )
func github.com/gorilla/websocket.NewClient (netConn net .Conn , u *URL , requestHeader http .Header , readBufSize, writeBufSize int ) (c *websocket .Conn , response *http .Response , err error )
func github.com/huin/goupnp.DeviceByURL (loc *URL ) (*goupnp .RootDevice , error )
func github.com/huin/goupnp.DeviceByURLCtx (ctx context .Context , loc *URL ) (*goupnp .RootDevice , error )
func github.com/huin/goupnp.NewServiceClientsByURL (loc *URL , searchTarget string ) ([]goupnp .ServiceClient , error )
func github.com/huin/goupnp.NewServiceClientsByURLCtx (ctx context .Context , loc *URL , searchTarget string ) ([]goupnp .ServiceClient , error )
func github.com/huin/goupnp.NewServiceClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL , searchTarget string ) ([]goupnp .ServiceClient , error )
func github.com/huin/goupnp.(*Device ).SetURLBase (urlBase *URL )
func github.com/huin/goupnp.(*Icon ).SetURLBase (url *URL )
func github.com/huin/goupnp.(*RootDevice ).SetURLBase (urlBase *URL )
func github.com/huin/goupnp.(*Service ).SetURLBase (urlBase *URL )
func github.com/huin/goupnp.(*URLField ).SetURLBase (urlBase *URL )
func github.com/huin/goupnp/dcps/internetgateway1.NewLANHostConfigManagement1ClientsByURL (loc *URL ) ([]*internetgateway1 .LANHostConfigManagement1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewLANHostConfigManagement1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway1 .LANHostConfigManagement1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewLANHostConfigManagement1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway1 .LANHostConfigManagement1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewLayer3Forwarding1ClientsByURL (loc *URL ) ([]*internetgateway1 .Layer3Forwarding1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewLayer3Forwarding1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway1 .Layer3Forwarding1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewLayer3Forwarding1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway1 .Layer3Forwarding1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANCableLinkConfig1ClientsByURL (loc *URL ) ([]*internetgateway1 .WANCableLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANCableLinkConfig1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway1 .WANCableLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANCableLinkConfig1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway1 .WANCableLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANCommonInterfaceConfig1ClientsByURL (loc *URL ) ([]*internetgateway1 .WANCommonInterfaceConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANCommonInterfaceConfig1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway1 .WANCommonInterfaceConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANCommonInterfaceConfig1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway1 .WANCommonInterfaceConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANDSLLinkConfig1ClientsByURL (loc *URL ) ([]*internetgateway1 .WANDSLLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANDSLLinkConfig1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway1 .WANDSLLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANDSLLinkConfig1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway1 .WANDSLLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANEthernetLinkConfig1ClientsByURL (loc *URL ) ([]*internetgateway1 .WANEthernetLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANEthernetLinkConfig1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway1 .WANEthernetLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANEthernetLinkConfig1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway1 .WANEthernetLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANIPConnection1ClientsByURL (loc *URL ) ([]*internetgateway1 .WANIPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANIPConnection1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway1 .WANIPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANIPConnection1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway1 .WANIPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANPOTSLinkConfig1ClientsByURL (loc *URL ) ([]*internetgateway1 .WANPOTSLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANPOTSLinkConfig1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway1 .WANPOTSLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANPOTSLinkConfig1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway1 .WANPOTSLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANPPPConnection1ClientsByURL (loc *URL ) ([]*internetgateway1 .WANPPPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANPPPConnection1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway1 .WANPPPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway1.NewWANPPPConnection1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway1 .WANPPPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewDeviceProtection1ClientsByURL (loc *URL ) ([]*internetgateway2 .DeviceProtection1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewDeviceProtection1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .DeviceProtection1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewDeviceProtection1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .DeviceProtection1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewLANHostConfigManagement1ClientsByURL (loc *URL ) ([]*internetgateway2 .LANHostConfigManagement1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewLANHostConfigManagement1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .LANHostConfigManagement1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewLANHostConfigManagement1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .LANHostConfigManagement1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewLayer3Forwarding1ClientsByURL (loc *URL ) ([]*internetgateway2 .Layer3Forwarding1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewLayer3Forwarding1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .Layer3Forwarding1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewLayer3Forwarding1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .Layer3Forwarding1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANCableLinkConfig1ClientsByURL (loc *URL ) ([]*internetgateway2 .WANCableLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANCableLinkConfig1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .WANCableLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANCableLinkConfig1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .WANCableLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANCommonInterfaceConfig1ClientsByURL (loc *URL ) ([]*internetgateway2 .WANCommonInterfaceConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANCommonInterfaceConfig1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .WANCommonInterfaceConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANCommonInterfaceConfig1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .WANCommonInterfaceConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANDSLLinkConfig1ClientsByURL (loc *URL ) ([]*internetgateway2 .WANDSLLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANDSLLinkConfig1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .WANDSLLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANDSLLinkConfig1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .WANDSLLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANEthernetLinkConfig1ClientsByURL (loc *URL ) ([]*internetgateway2 .WANEthernetLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANEthernetLinkConfig1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .WANEthernetLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANEthernetLinkConfig1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .WANEthernetLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANIPConnection1ClientsByURL (loc *URL ) ([]*internetgateway2 .WANIPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANIPConnection1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .WANIPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANIPConnection1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .WANIPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANIPConnection2ClientsByURL (loc *URL ) ([]*internetgateway2 .WANIPConnection2 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANIPConnection2ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .WANIPConnection2 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANIPConnection2ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .WANIPConnection2 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANIPv6FirewallControl1ClientsByURL (loc *URL ) ([]*internetgateway2 .WANIPv6FirewallControl1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANIPv6FirewallControl1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .WANIPv6FirewallControl1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANIPv6FirewallControl1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .WANIPv6FirewallControl1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANPOTSLinkConfig1ClientsByURL (loc *URL ) ([]*internetgateway2 .WANPOTSLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANPOTSLinkConfig1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .WANPOTSLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANPOTSLinkConfig1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .WANPOTSLinkConfig1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANPPPConnection1ClientsByURL (loc *URL ) ([]*internetgateway2 .WANPPPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANPPPConnection1ClientsByURLCtx (ctx context .Context , loc *URL ) ([]*internetgateway2 .WANPPPConnection1 , error )
func github.com/huin/goupnp/dcps/internetgateway2.NewWANPPPConnection1ClientsFromRootDevice (rootDevice *goupnp .RootDevice , loc *URL ) ([]*internetgateway2 .WANPPPConnection1 , error )
func github.com/huin/goupnp/soap.MarshalURI (v *URL ) (string , error )
func github.com/huin/goupnp/soap.NewSOAPClient (endpointURL URL ) *soap .SOAPClient
func golang.org/x/net/proxy.FromURL (u *URL , forward proxy .Dialer ) (proxy .Dialer , error )
type Values (map)
Values maps a string key to a list of values.
It is typically used for query parameters and form values.
Unlike in the http.Header map, the keys in a Values map
are case-sensitive.
Methods (total 6 )
( Values) Add (key, value string )
Add adds the value to key. It appends to any existing
values associated with key.
( Values) Del (key string )
Del deletes the values associated with key.
( Values) Encode () string
Encode encodes the values into “URL encoded” form
("bar=baz&foo=quux") sorted by key.
( Values) Get (key string ) string
Get gets the first value associated with the given key.
If there are no values associated with the key, Get returns
the empty string. To access multiple values, use the map
directly.
( Values) Has (key string ) bool
Has checks whether a given key is set.
( Values) Set (key, value string )
Set sets the key to value. It replaces any existing
values.
Implements (at least one exported )
Values : github.com/redis/go-redis/v9.ConsistentHash
As Outputs Of (at least 4 )
func ParseQuery (query string ) (Values , error )
func (*URL ).Query () Values
func github.com/google/go-querystring/query.Values (v interface{}) (Values , error )
func github.com/ncruces/go-sqlite3/vfs.(*Filename ).URIParameters () Values
As Inputs Of (at least 56 )
func net/http.PostForm (url string , data Values ) (resp *http .Response , err error )
func net/http.(*Client ).PostForm (url string , data Values ) (resp *http .Response , err error )
func github.com/google/go-querystring/query.Encoder .EncodeValues (key string , v *Values ) error
func github.com/grpc-ecosystem/grpc-gateway/v2/runtime.PopulateQueryParameters (msg proto .Message , values Values , filter *utilities .DoubleArray ) error
func github.com/grpc-ecosystem/grpc-gateway/v2/runtime.(*DefaultQueryParser ).Parse (msg proto .Message , values Values , filter *utilities .DoubleArray ) error
func github.com/grpc-ecosystem/grpc-gateway/v2/runtime.QueryParameterParser .Parse (msg proto .Message , values Values , filter *utilities .DoubleArray ) error
func github.com/stretchr/testify/assert.HTTPBody (handler http .HandlerFunc , method, url string , values Values ) string
func github.com/stretchr/testify/assert.HTTPBodyContains (t assert .TestingT , handler http .HandlerFunc , method, url string , values Values , str interface{}, msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPBodyContainsf (t assert .TestingT , handler http .HandlerFunc , method string , url string , values Values , str interface{}, msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPBodyNotContains (t assert .TestingT , handler http .HandlerFunc , method, url string , values Values , str interface{}, msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPBodyNotContainsf (t assert .TestingT , handler http .HandlerFunc , method string , url string , values Values , str interface{}, msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPError (t assert .TestingT , handler http .HandlerFunc , method, url string , values Values , msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPErrorf (t assert .TestingT , handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPRedirect (t assert .TestingT , handler http .HandlerFunc , method, url string , values Values , msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPRedirectf (t assert .TestingT , handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPStatusCode (t assert .TestingT , handler http .HandlerFunc , method, url string , values Values , statuscode int , msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPStatusCodef (t assert .TestingT , handler http .HandlerFunc , method string , url string , values Values , statuscode int , msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPSuccess (t assert .TestingT , handler http .HandlerFunc , method, url string , values Values , msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.HTTPSuccessf (t assert .TestingT , handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPBodyContains (handler http .HandlerFunc , method string , url string , values Values , str interface{}, msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPBodyContainsf (handler http .HandlerFunc , method string , url string , values Values , str interface{}, msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPBodyNotContains (handler http .HandlerFunc , method string , url string , values Values , str interface{}, msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPBodyNotContainsf (handler http .HandlerFunc , method string , url string , values Values , str interface{}, msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPError (handler http .HandlerFunc , method string , url string , values Values , msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPErrorf (handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPRedirect (handler http .HandlerFunc , method string , url string , values Values , msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPRedirectf (handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPStatusCode (handler http .HandlerFunc , method string , url string , values Values , statuscode int , msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPStatusCodef (handler http .HandlerFunc , method string , url string , values Values , statuscode int , msg string , args ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPSuccess (handler http .HandlerFunc , method string , url string , values Values , msgAndArgs ...interface{}) bool
func github.com/stretchr/testify/assert.(*Assertions ).HTTPSuccessf (handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{}) bool
func github.com/stretchr/testify/require.HTTPBodyContains (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , str interface{}, msgAndArgs ...interface{})
func github.com/stretchr/testify/require.HTTPBodyContainsf (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , str interface{}, msg string , args ...interface{})
func github.com/stretchr/testify/require.HTTPBodyNotContains (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , str interface{}, msgAndArgs ...interface{})
func github.com/stretchr/testify/require.HTTPBodyNotContainsf (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , str interface{}, msg string , args ...interface{})
func github.com/stretchr/testify/require.HTTPError (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , msgAndArgs ...interface{})
func github.com/stretchr/testify/require.HTTPErrorf (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{})
func github.com/stretchr/testify/require.HTTPRedirect (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , msgAndArgs ...interface{})
func github.com/stretchr/testify/require.HTTPRedirectf (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{})
func github.com/stretchr/testify/require.HTTPStatusCode (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , statuscode int , msgAndArgs ...interface{})
func github.com/stretchr/testify/require.HTTPStatusCodef (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , statuscode int , msg string , args ...interface{})
func github.com/stretchr/testify/require.HTTPSuccess (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , msgAndArgs ...interface{})
func github.com/stretchr/testify/require.HTTPSuccessf (t require .TestingT , handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPBodyContains (handler http .HandlerFunc , method string , url string , values Values , str interface{}, msgAndArgs ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPBodyContainsf (handler http .HandlerFunc , method string , url string , values Values , str interface{}, msg string , args ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPBodyNotContains (handler http .HandlerFunc , method string , url string , values Values , str interface{}, msgAndArgs ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPBodyNotContainsf (handler http .HandlerFunc , method string , url string , values Values , str interface{}, msg string , args ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPError (handler http .HandlerFunc , method string , url string , values Values , msgAndArgs ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPErrorf (handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPRedirect (handler http .HandlerFunc , method string , url string , values Values , msgAndArgs ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPRedirectf (handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPStatusCode (handler http .HandlerFunc , method string , url string , values Values , statuscode int , msgAndArgs ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPStatusCodef (handler http .HandlerFunc , method string , url string , values Values , statuscode int , msg string , args ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPSuccess (handler http .HandlerFunc , method string , url string , values Values , msgAndArgs ...interface{})
func github.com/stretchr/testify/require.(*Assertions ).HTTPSuccessf (handler http .HandlerFunc , method string , url string , values Values , msg string , args ...interface{})
func golang.org/x/oauth2/internal.RetrieveToken (ctx context .Context , clientID, clientSecret, tokenURL string , v Values , authStyle internal .AuthStyle , styleCache *internal .AuthStyleCache ) (*internal .Token , error )
Package-Level Functions (total 10)
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .