Skip to content

Commit

Permalink
Add KVMap constructor
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Oct 19, 2023
1 parent a9f7b06 commit bf868a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hub/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ type KVMap struct {

var _ KV = &KVMap{}

func NewKVMap(cache map[string]*v1alpha1.ResourceDescriptor) KV {
return &KVMap{cache: cache}
}

func (s *KVMap) Set(key string, val *v1alpha1.ResourceDescriptor) {
s.m.Lock()
s.cache[key] = val
Expand Down

0 comments on commit bf868a2

Please sign in to comment.