Skip to content

Commit

Permalink
🧹 move inmemory/kiss.go -> inmemory/store/kiss.go
Browse files Browse the repository at this point in the history
Signed-off-by: Salim Afiune Maya <[email protected]>
  • Loading branch information
afiune committed Dec 12, 2024
1 parent 26470a7 commit 387ef36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions internal/datalakes/inmemory/inmemory.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ import (

"github.com/google/uuid"
"go.mondoo.com/cnquery/v11/explorer"
"go.mondoo.com/cnquery/v11/internal/datalakes/inmemory/store"
"go.mondoo.com/cnquery/v11/llx"
)

// Db is the database backend, it allows the interaction with the underlying data.
type Db struct {
cache KVStore
cache store.KeyValue
services *explorer.LocalServices // bidirectional connection between db + services
uuid string // used for all object identifiers to prevent clashes (eg in-memory pubsub)
nowProvider func() time.Time
}

// NewServices creates a new set of backend services
func NewServices(runtime llx.Runtime) (*Db, *explorer.LocalServices, error) {
var cache KVStore = NewKissDb()
var cache store.KeyValue = store.NewKissDb()

db := &Db{
cache: cache,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Copyright (c) Mondoo, Inc.
// SPDX-License-Identifier: BUSL-1.1

package inmemory
package store

import "sync"

// KVStore is an general-purpose abstraction for key-value stores
type KVStore interface {
// KeyValue is an general-purpose abstraction for key-value stores
type KeyValue interface {
Get(key interface{}) (interface{}, bool)
Set(key interface{}, value interface{}, cost int64) bool
Del(key interface{})
Expand Down

0 comments on commit 387ef36

Please sign in to comment.