summaryrefslogtreecommitdiff
path: root/system/db/cache.go
diff options
context:
space:
mode:
authorSteve <nilslice@gmail.com>2016-12-19 11:19:53 -0800
committerGitHub <noreply@github.com>2016-12-19 11:19:53 -0800
commit3791fadda7b761ffba38c567da29e2e71acd1dfb (patch)
tree79d810f9aafa1868ee0760983937470d0eea3db8 /system/db/cache.go
parentb20c5bdee38682edc851e646d815a34689c3c923 (diff)
[addons] Creating foundation for plugin-like system "Addons" (#24)
* adding addons dir and sample addon which enables the use of a new input element in forms for referencing other content. "addons" is a conceptual plugin-like feature, similar to wordpress "plugins" dir, but not as sophisticated
Diffstat (limited to 'system/db/cache.go')
-rw-r--r--system/db/cache.go35
1 files changed, 1 insertions, 34 deletions
diff --git a/system/db/cache.go b/system/db/cache.go
index 5f2dd03..30ecf5a 100644
--- a/system/db/cache.go
+++ b/system/db/cache.go
@@ -2,10 +2,8 @@ package db
import (
"encoding/base64"
- "encoding/json"
"fmt"
"net/http"
- "net/url"
"strings"
"time"
)
@@ -39,41 +37,10 @@ func NewEtag() string {
// InvalidateCache sets a new Etag for http responses
func InvalidateCache() error {
- kv := make(map[string]interface{})
-
- c, err := ConfigAll()
+ err := PutConfig("etag", NewEtag())
if err != nil {
return err
}
- err = json.Unmarshal(c, &kv)
- if err != nil {
- return err
- }
-
- kv["etag"] = NewEtag()
-
- data := make(url.Values)
- for k, v := range kv {
- switch v.(type) {
- case string:
- data.Set(k, v.(string))
- case []string:
- vv := v.([]string)
- for i := range vv {
- if i == 0 {
- data.Set(k, vv[i])
- } else {
- data.Add(k, vv[i])
- }
- }
- }
- }
-
- err = SetConfig(data)
- if err != nil {
-
- }
-
return nil
}