aboutsummaryrefslogtreecommitdiff
path: root/cache
diff options
context:
space:
mode:
authorJacky Zhao <[email protected]>2020-05-09 16:02:10 -0700
committerGitHub <[email protected]>2020-05-09 16:02:10 -0700
commit6e69cfa1794d20e3dd41ea9074a7c8a79d51c099 (patch)
treefe078d33c11e21b684af8f400d1667b2411c5415 /cache
parentfix port bug (diff)
parentLowercase json response (diff)
downloadctrl-v-6e69cfa1794d20e3dd41ea9074a7c8a79d51c099.tar.xz
ctrl-v-6e69cfa1794d20e3dd41ea9074a7c8a79d51c099.zip
Merge pull request #2 from jackyzha0/api
Add get hash endpoint
Diffstat (limited to 'cache')
-rw-r--r--cache/cache.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cache/cache.go b/cache/cache.go
index b311efa..bac7ea8 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -11,8 +11,10 @@ type Cache struct {
lock sync.RWMutex
}
-func New() *Cache {
- return &Cache{
+var C *Cache
+
+func init() {
+ C = &Cache{
m: map[string]db.Paste{},
}
}