cleanup
This commit is contained in:
parent
3d47c80446
commit
49f613ddeb
15 changed files with 98 additions and 234 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"html/template"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -26,8 +27,14 @@ var (
|
|||
return string(jsonBytes), nil
|
||||
},
|
||||
}
|
||||
searchEngines []SearchEngine
|
||||
)
|
||||
|
||||
type SearchEngine struct {
|
||||
Name string
|
||||
Func func(string, string, string, int) ([]SearchResult, time.Duration, error)
|
||||
}
|
||||
|
||||
// Helper function to render templates without elapsed time measurement
|
||||
func renderTemplate(w http.ResponseWriter, tmplName string, data map[string]interface{}) {
|
||||
// Parse the template with common functions (including translate)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue