Documentation ¶
Overview ¶
Package storage provides a Bundle Storage based on BadgerHold, a frontend for the badger NoSQL store.
Index ¶
- type BundleItem
- type BundlePart
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(bid bpv7.BundleID) error
- func (s *Store) DeleteExpired()
- func (s *Store) KnowsBundle(bid bpv7.BundleID) bool
- func (s *Store) Push(b bpv7.Bundle) error
- func (s *Store) QueryId(bid bpv7.BundleID) (bi BundleItem, err error)
- func (s *Store) QueryPending() (bis []BundleItem, err error)
- func (s *Store) Update(bi BundleItem) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BundleItem ¶
type BundleItem struct { Id string `badgerhold:"key"` BId bpv7.BundleID Pending bool `badgerholdIndex:"Pending"` Expires time.Time `badgerholdIndex:"Expires"` Fragmented bool Parts []BundlePart Properties map[string]interface{} }
BundleItem is a wrapper for meta data around a Bundle. The Store operates on BundleItems instead of Bundles.
func (BundleItem) IsComplete ¶
func (bi BundleItem) IsComplete() bool
IsComplete determines if the BundleItem is complete and can be Load()ed.
type BundlePart ¶
BundlePart links a BundleItem to a Bundle with possible information regarding fragmentation.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements a storage for Bundles together with meta data.
func (*Store) DeleteExpired ¶
func (s *Store) DeleteExpired()
DeleteExpired removes all expired Bundles.
func (*Store) KnowsBundle ¶
KnowsBundle checks if such a Bundle is known.
func (*Store) QueryId ¶
func (s *Store) QueryId(bid bpv7.BundleID) (bi BundleItem, err error)
QueryId fetches the BundleItem for the requested BundleID.
func (*Store) QueryPending ¶
func (s *Store) QueryPending() (bis []BundleItem, err error)
QueryPending fetches all pending Bundles.