 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
Docstore provides an indexed JSON document store.
It is used by various services to store their data instead of implementing yet-another persistence layer. It uses a combination of Bolt for storage and Bleve for indexation.
Index ¶
- type BleveServer
- func (s *BleveServer) Close() error
- func (s *BleveServer) DeleteDocument(storeID string, docID string) error
- func (s *BleveServer) IndexDocument(storeID string, doc *docstore.Document) error
- func (s *BleveServer) Reset() error
- func (s *BleveServer) SearchDocuments(storeID string, query *docstore.DocumentQuery, countOnly bool) ([]string, int64, error)
 
- type BoltStore
- func (b *BoltStore) Close() error
- func (s *BoltStore) DeleteDocument(storeID string, docID string) error
- func (s *BoltStore) GetDocument(storeID string, docId string) (*docstore.Document, error)
- func (s *BoltStore) GetStore(tx *bolt.Tx, storeID string, mode string) (*bolt.Bucket, error)
- func (s *BoltStore) ListDocuments(storeID string, query *docstore.DocumentQuery) (chan *docstore.Document, chan bool, error)
- func (s *BoltStore) ListStores() ([]string, error)
- func (s *BoltStore) PutDocument(storeID string, doc *docstore.Document) error
 
- type Indexer
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BleveServer ¶
type BleveServer struct {
	// Internal Bleve database
	Engine bleve.Index
	// For Testing purpose : delete file after closing
	DeleteOnClose bool
	// Path to the DB file
	IndexPath string
}
    func NewBleveEngine ¶
func NewBleveEngine(bleveIndexPath string, deleteOnClose ...bool) (*BleveServer, error)
func (*BleveServer) Close ¶
func (s *BleveServer) Close() error
func (*BleveServer) DeleteDocument ¶
func (s *BleveServer) DeleteDocument(storeID string, docID string) error
func (*BleveServer) IndexDocument ¶
func (s *BleveServer) IndexDocument(storeID string, doc *docstore.Document) error
func (*BleveServer) Reset ¶ added in v1.5.2
func (s *BleveServer) Reset() error
func (*BleveServer) SearchDocuments ¶
func (s *BleveServer) SearchDocuments(storeID string, query *docstore.DocumentQuery, countOnly bool) ([]string, int64, error)
type BoltStore ¶
type BoltStore struct {
	// For Testing purpose : delete file after closing
	DeleteOnClose bool
	// Path to the DB file
	DbPath string
	// contains filtered or unexported fields
}
    func (*BoltStore) DeleteDocument ¶
func (*BoltStore) GetDocument ¶
func (*BoltStore) GetStore ¶
func (*BoltStore) ListDocuments ¶
func (*BoltStore) ListStores ¶ added in v1.5.2
ListStores list all buckets
type Indexer ¶
type Store ¶
type Store interface {
	PutDocument(storeID string, doc *docstore.Document) error
	GetDocument(storeID string, docId string) (*docstore.Document, error)
	DeleteDocument(storeID string, docID string) error
	ListDocuments(storeID string, query *docstore.DocumentQuery) (chan *docstore.Document, chan bool, error)
	ListStores() ([]string, error)
	Close() error
}
    
       Source Files
      ¶
      Source Files
      ¶
    
- bleve.go
- bolt.go
- dao.go
 Click to show internal directories. 
   Click to hide internal directories.