• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

foomo / posh / 14267892308

04 Apr 2025 02:41PM UTC coverage: 6.101% (-0.07%) from 6.172%
14267892308

push

github

web-flow
Merge pull request #110 from foomo/feature/v0.11.0

feat: v0.11.0

3 of 122 new or added lines in 9 files covered. (2.46%)

5 existing lines in 2 files now uncovered.

159 of 2606 relevant lines covered (6.1%)

0.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pkg/cache/memorycache.go
1
package cache
2

3
import (
4
        "sync"
5
)
6

7
type MemoryCache struct {
8
        store sync.Map
9
}
10

NEW
11
func NewMemoryCache() *MemoryCache {
×
NEW
12
        return &MemoryCache{
×
NEW
13
                store: sync.Map{},
×
UNCOV
14
        }
×
UNCOV
15
}
×
16

NEW
17
func (c *MemoryCache) Clear(namespaces ...string) {
×
NEW
18
        if len(namespaces) == 0 {
×
NEW
19
                c.store.Range(func(key, value interface{}) bool {
×
NEW
20
                        namespaces = append(namespaces, key.(string)) //nolint:forcetypeassert
×
NEW
21
                        return true
×
NEW
22
                })
×
23
        }
NEW
24
        for _, namespace := range namespaces {
×
NEW
25
                c.Get(namespace).Delete()
×
NEW
26
        }
×
27
}
28

NEW
29
func (c *MemoryCache) Get(namespace string) Namespace {
×
NEW
30
        value, _ := c.store.LoadOrStore(namespace, &MemoryNamespace{
×
NEW
31
                store: sync.Map{},
×
NEW
32
        })
×
NEW
33
        return value.(*MemoryNamespace) //nolint:forcetypeassert
×
UNCOV
34
}
×
35

NEW
36
func (c *MemoryCache) List() map[string]Namespace {
×
37
        ret := map[string]Namespace{}
×
NEW
38
        c.store.Range(func(k, v interface{}) bool {
×
NEW
39
                ret[k.(string)] = v.(*MemoryNamespace) //nolint:forcetypeassert
×
NEW
40
                return true
×
NEW
41
        })
×
UNCOV
42
        return ret
×
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc