···2233import "sync"
4455-/// Cache for pages
55+// Cache for pages
6677type TmplCache[K comparable, V any] struct {
88 data map[K]V
+1-2
pages/pages.go
···131131func Cache(h http.Handler) http.Handler {
132132 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
133133 path := strings.Split(r.URL.Path, "?")[0]
134134-135135- //We may want to change these, just took what tangled has and allows browser side caching
134134+ // We may want to change these, just took what tangled has and allows browser side caching
136135 if strings.HasSuffix(path, ".css") {
137136 // on day for css files
138137 w.Header().Set("Cache-Control", "public, max-age=86400")
-7
service/apikey/apikey.go
···203203 newKeyValueToShow = newlyCreatedKeyID
204204 }
205205206206- //t, err := template.New("apikeys").Funcs(funcMap).Parse(tmpl)
207207- if err != nil {
208208- http.Error(w, fmt.Sprintf("Error parsing template: %v", err), http.StatusInternalServerError)
209209- return
210210- }
211211-212206 data := struct {
213207 Keys []*db_apikey.ApiKey // Assuming GetUserApiKeys returns this type
214208 NewKeyID string // Changed from NewKey for clarity as it's an ID
···228222 if err != nil {
229223 log.Printf("Error executing template: %v", err)
230224 }
231231- //t.Execute(w, data)
232225 }
233226}