MCPcopy Index your code
hub / github.com/dnote/dnote / getBaseURL

Function getBaseURL

pkg/cli/cmd/login/login.go:113–124  ·  view source on GitHub ↗
(rawURL string)

Source from the content-addressed store, hash-verified

111}
112
113func getBaseURL(rawURL string) (string, error) {
114 u, err := url.Parse(rawURL)
115 if err != nil {
116 return "", errors.Wrap(err, "parsing url")
117 }
118
119 if u.Scheme == "" || u.Host == "" {
120 return "", nil
121 }
122
123 return fmt.Sprintf("%s://%s", u.Scheme, u.Host), nil
124}
125
126func getServerDisplayURL(ctx context.DnoteCtx) string {
127 baseURL, err := getBaseURL(ctx.APIEndpoint)

Callers 1

getServerDisplayURLFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected