Skip to content

Commit c59901f

Browse files
committed
add ctx store
1 parent 62ad537 commit c59901f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/konnector/controllers/contextstore/contextstore.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func NewKey(export kubebindv1alpha2.APIServiceExport) Key {
3636
return Key(export.Namespace + "/" + export.Name)
3737
}
3838

39-
type ContextStore interface {
39+
type Store interface {
4040
Get(key Key) (SyncContext, bool)
4141
Set(key Key, value SyncContext)
4242
Delete(key Key)
@@ -52,7 +52,7 @@ type SyncContext struct {
5252
cancel func()
5353
}
5454

55-
func New() ContextStore {
55+
func New() Store {
5656
return &contextStore{
5757
store: make(map[Key]SyncContext),
5858
}
@@ -62,6 +62,10 @@ func (c *SyncContext) Generation() int64 {
6262
return c.generation
6363
}
6464

65+
func (c *SyncContext) Cancel() {
66+
c.cancel()
67+
}
68+
6569
func (c *contextStore) Get(key Key) (SyncContext, bool) {
6670
c.lock.Lock()
6771
defer c.lock.Unlock()

0 commit comments

Comments
 (0)