MCPcopy Index your code
hub / github.com/coder/coder / normalizeHost

Function normalizeHost

cli/sessionstore/sessionstore.go:80–85  ·  view source on GitHub ↗

normalizeHost returns a normalized version of the URL host for use as a map key.

(u *url.URL)

Source from the content-addressed store, hash-verified

78
79// normalizeHost returns a normalized version of the URL host for use as a map key.
80func normalizeHost(u *url.URL) (string, error) {
81 if u == nil || u.Host == "" {
82 return "", xerrors.New("nil server URL")
83 }
84 return strings.TrimSpace(strings.ToLower(u.Host)), nil
85}
86
87// parseCredentialsJSON parses the JSON from the keyring into a credentialsMap.
88func parseCredentialsJSON(jsonData []byte) (credentialsMap, error) {

Callers 4

ReadMethod · 0.70
WriteMethod · 0.70
DeleteMethod · 0.70
TestNormalizeHostFunction · 0.70

Calls 1

NewMethod · 0.65

Tested by 1

TestNormalizeHostFunction · 0.56