tsweb: rename Handler to ReturnHandler

The name's been bugging me for a long time.

I liked neither the overlap between tsweb.Handler and http.Handler,
nor the name "ServeHTTPErr" which sounds like it's an error being
returned, like it's an error handler and not sometimes a happy path.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-04-05 09:29:24 -07:00
committed by Brad Fitzpatrick
parent bdc55d7091
commit 64334143a1
3 changed files with 38 additions and 41 deletions

View File

@@ -95,7 +95,7 @@ func promPrint(w io.Writer, prefix string, obj map[string]interface{}) {
}
}
func (h *goVarsHandler) ServeHTTPErr(w http.ResponseWriter, r *http.Request) error {
func (h *goVarsHandler) ServeHTTPReturn(w http.ResponseWriter, r *http.Request) error {
resp, err := http.Get(h.url)
if err != nil {
return tsweb.Error(http.StatusInternalServerError, "fetch failed", err)