package internal import ( "fmt" "net/http" "github.com/julienschmidt/httprouter" ) const OpenSearchTemplate string = ` %s %s search %s ` // OpenSearchHandler ... func (s *Server) OpenSearchHandler() httprouter.Handle { return func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { w.Header().Set("Content-Type", "text/xml") w.Write( []byte(fmt.Sprintf( OpenSearchTemplate, s.config.Name, s.config.Description, s.config.AdminEmail, s.config.BaseURL, )), ) } }