Documentation ¶
Overview ¶
Package cb implements the DataStore interface for CouchBase
Index ¶
- type Cb
- func (ds *Cb) Browse(bucket string, where string, offset int64, limit int64, sort string, ...) ([]interface{}, error)
- func (ds *Cb) Bulk(items *[]fdc.NutrientData) error
- func (ds *Cb) BulkInsert(items []gocb.BulkOp) error
- func (ds *Cb) CloseDs()
- func (ds *Cb) ConnectDs(cs fdc.Config) error
- func (ds *Cb) Counts(bucket string, doctype string, c *[]interface{}) error
- func (ds Cb) FoodExists(id string) bool
- func (ds Cb) Get(q string, f interface{}) error
- func (ds *Cb) GetDictionary(bucket string, doctype string, offset int64, limit int64) ([]interface{}, error)
- func (ds *Cb) NutrientReport(bucket string, nr fdc.NutrientReportRequest, nutrients *[]interface{}) error
- func (ds Cb) Query(q string, f *[]interface{}) error
- func (ds *Cb) Remove(id string) error
- func (ds *Cb) Search(sr fdc.SearchRequest, foods *[]interface{}) (int, error)
- func (ds *Cb) Update(id string, r interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cb ¶
Cb implements a DataSource interface to CouchBase
func (*Cb) Browse ¶
func (ds *Cb) Browse(bucket string, where string, offset int64, limit int64, sort string, order string) ([]interface{}, error)
Browse fills out a slice of Foods, Nutrients or NutrientData items, returns gocb error
func (*Cb) Bulk ¶
func (ds *Cb) Bulk(items *[]fdc.NutrientData) error
Bulk inserts a list of Nutrient Data items
func (*Cb) BulkInsert ¶
BulkInsert uses gocb library to insert a list of items defined in BulkOp struct
func (Cb) FoodExists ¶
FoodExists uses Couchbase subdoc API to determine if a key exists or not
func (*Cb) GetDictionary ¶
func (ds *Cb) GetDictionary(bucket string, doctype string, offset int64, limit int64) ([]interface{}, error)
GetDictionary returns dictionary documents, e.g. food groups, nutrients, derivations, etc.
func (*Cb) NutrientReport ¶
func (ds *Cb) NutrientReport(bucket string, nr fdc.NutrientReportRequest, nutrients *[]interface{}) error
NutrientReport Runs a NutrientReportRequest
Click to show internal directories.
Click to hide internal directories.