mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
collapse memAttrStore
memAttrStore is not used, but I opted to leave it in order to encourage its use by future unit tests. Since it is unexported, however, and its fairly obvious what it does, I didn't think the docstrings were adding much value, and it's more readable in this compact form.
This commit is contained in:
parent
6ff792c164
commit
d73ff9bfe2
1 changed files with 6 additions and 31 deletions
37
attr.go
37
attr.go
|
|
@ -233,44 +233,19 @@ type memAttrStore struct {
|
|||
store map[uint64]map[string]interface{}
|
||||
}
|
||||
|
||||
// Path is an in-memory implementation of AttrStore Path method.
|
||||
func (s *memAttrStore) Path() string { return "" }
|
||||
|
||||
// Open is an in-memory implementation of AttrStore Open method.
|
||||
func (s *memAttrStore) Open() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Close is an in-memory implementation of AttrStore Close method.
|
||||
func (s *memAttrStore) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Attrs returns a set of attributes by ID.
|
||||
func (s *memAttrStore) Attrs(id uint64) (m map[string]interface{}, err error) {
|
||||
return s.store[id], nil
|
||||
}
|
||||
|
||||
// SetAttrs sets attribute values for a given ID.
|
||||
func (s *memAttrStore) Path() string { return "" }
|
||||
func (s *memAttrStore) Open() error { return nil }
|
||||
func (s *memAttrStore) Close() error { return nil }
|
||||
func (s *memAttrStore) Attrs(id uint64) (m map[string]interface{}, err error) { return s.store[id], nil }
|
||||
func (s *memAttrStore) SetAttrs(id uint64, m map[string]interface{}) error {
|
||||
s.store[id] = m
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetBulkAttrs sets attribute values for a set of ids.
|
||||
func (s *memAttrStore) SetBulkAttrs(m map[uint64]map[string]interface{}) error {
|
||||
for id, v := range m {
|
||||
s.store[id] = v
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Blocks is an in-memory implementation of AttrStore Blocks method.
|
||||
func (s *memAttrStore) Blocks() ([]AttrBlock, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// BlockData is an in-memory implementation of AttrStore BlockData method.
|
||||
func (s *memAttrStore) BlockData(i uint64) (map[uint64]map[string]interface{}, error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (s *memAttrStore) Blocks() ([]AttrBlock, error) { return nil, nil }
|
||||
func (s *memAttrStore) BlockData(i uint64) (map[uint64]map[string]interface{}, error) { return nil, nil }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue