Documentation ¶
Overview ¶
Package bboltd provides a BBoltDB driver for go-shelve.
Index ¶
- func Open(path string, mode os.FileMode, options *bbolt.Options) (*bbolt.DB, error)
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(key []byte) error
- func (s *Store) Get(key []byte) ([]byte, error)
- func (s *Store) Has(key []byte) (bool, error)
- func (s *Store) Items(start []byte, order int, fn func(key, value []byte) (bool, error)) error
- func (s *Store) Len() int64
- func (s *Store) Put(key, value []byte) error
- func (s *Store) Sync() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a BoltDB driver for shelve.Shelf.
func NewDefault ¶
NewDefault creates a new BoltDB store with sensible default values. The bucket is created if it doesn't exist.
func (*Store) Get ¶
Get retrieves the value associated with a key from the store. If the key is not found, it returns nil.
func (*Store) Items ¶
Items iterates over key-value pairs in the database, calling fn(k, v) for each pair in the sequence. The iteration stops early if the function fn returns false.
The start parameter specifies the key from which the iteration should start. If the start parameter is nil, the iteration will begin from the first key in the database.
The order parameter specifies the order in which the items should be yielded. A negative value for order will cause the iteration to occur in reverse order.
The key-value pairs are returned in lexicographically sorted order.