Add non-bucket StringListContains
This commit is contained in:
parent
2ff40dcfdc
commit
e31f75cb63
13
boltease.go
13
boltease.go
@ -660,6 +660,19 @@ func (b *DB) AddToStringList(path []string, values ...string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (b *DB) StringListContains(path []string, value string) (bool, error) {
|
||||
list, err := b.GetStringList(path)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
for i := range list {
|
||||
if list[i] == value {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// GetKeyValueMap returns a map of all key/value pairs in the bucket at path
|
||||
func (b *DB) GetKeyValueMap(path []string) (map[string][]byte, error) {
|
||||
var err error
|
||||
|
Loading…
Reference in New Issue
Block a user