Skip to content

Commit

Permalink
values query functions
Browse files Browse the repository at this point in the history
- IsExists() -> checks if key exists
- List() -> returns the raw content of MiniStore
  • Loading branch information
tbdsux committed May 30, 2021
1 parent ba21b01 commit b854476
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions values-query.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,15 @@ func (db *MiniStore) GetFloat64Slice(key string) []float64 {
func (db *MiniStore) Get(key string) (interface{}, bool) {
return db.getValueOK(key)
}

// IsExists asserts if the key exists. You should use Get() if you want to get
// the Raw value and if it exists.
func (db *MiniStore) IsExists(key string) bool {
_, ok := db.getValueOK(key)
return ok
}

// List returns the content of db.store
func (db *MiniStore) List() map[string]interface{} {
return db.store
}

0 comments on commit b854476

Please sign in to comment.