Documentation ¶
Index ¶
- Variables
- func AggregateData(in query.InputDA) (map[string]interface{}, error)
- func CreateConcept(in *query.Concept, isEncrypted bool) error
- func CreateConceptInConductorDB(in *query.InputCI) error
- func DeleteConcept(in *query.Concept, isEncrypted bool) error
- func GetConcept(in *query.Concept, isEncrypted bool) error
- func QueryTarget(in query.InputT) error
- func RetrieveSubscribeDoc(hash []byte) ([]subscribe.SubscribeDoc, error)
- func SelectAddresses(in query.InputTF) ([]string, error)
- func Subscribe(in *subscribe.InputConductor) error
- type ConceptDoc
- type QueryDoc
- func (q *QueryDoc) Clone() couchdb.Doc
- func (q *QueryDoc) DocType() string
- func (q *QueryDoc) ID() string
- func (q *QueryDoc) Lead() error
- func (q *QueryDoc) Rev() string
- func (q *QueryDoc) SetID(id string)
- func (q *QueryDoc) SetRev(rev string)
- func (q *QueryDoc) ShouldBeComputed(indexLayer int) (bool, error)
- func (q *QueryDoc) TryToEndQuery() error
Constants ¶
This section is empty.
Variables ¶
var ( ConductorURL = url.URL{} // PrefixerC is exported to easilly pass in dev-mode PrefixerC = prefixer.ConductorPrefixer )
var PrefixerCI = prefixer.ConceptIndexorPrefixer
Functions ¶
func AggregateData ¶
AggregateData leads an aggregation of data
func CreateConcept ¶
CreateConcept checks if concept exists in db. If yes, return error. If no, create the salt, save the concept in db and return the hash.
func CreateConceptInConductorDB ¶
CreateConceptInConductorDB is used to add a concept to Cozy-DISPERS
func DeleteConcept ¶
DeleteConcept is used to delete a concept in ConceptIndexor Database.
func GetConcept ¶
GetConcept gets a concept from db. If no, return error.
func QueryTarget ¶
QueryTarget decrypts instance given by the conductor and build queries
func RetrieveSubscribeDoc ¶
func RetrieveSubscribeDoc(hash []byte) ([]subscribe.SubscribeDoc, error)
RetrieveSubscribeDoc is used to get a Subscribe doc from the Conductor's database. It returns either an empty array of SubscribeDoc or an array of length 1 It returns an error if there is more than 1 subscribe doc.
func SelectAddresses ¶
SelectAddresses apply the target profile over lists of addresses
func Subscribe ¶
func Subscribe(in *subscribe.InputConductor) error
Subscribe leads the subscription process
Types ¶
type ConceptDoc ¶
type ConceptDoc struct { ConceptID string `json:"_id,omitempty"` ConceptRev string `json:"_rev,omitempty"` Concept string `json:"concept,omitempty"` Hash []byte `json:"hash,omitempty"` Salt []byte `json:"salt,omitempty"` }
ConceptDoc is used to save a concept's salt into Concept Indexor's database hash and salt are saved in byte to avoid string's to be interpreted
func (*ConceptDoc) Clone ¶
func (t *ConceptDoc) Clone() couchdb.Doc
Clone is used to create another ConceptDoc from this ConceptDoc
type QueryDoc ¶
type QueryDoc struct { QueryID string `json:"_id,omitempty"` QueryRev string `json:"_rev,omitempty"` IsEncrypted bool `json:"encrypted,omitempty"` CheckPoints map[string]bool `json:"checkpoints,omitempty"` Layers []query.LayerDA `json:"layers,omitempty"` PseudoConcepts map[string]string `json:"pseudo_concepts,omitempty"` Results interface{} `json:"results,omitempty"` EncryptedConcepts []query.Concept `json:"concepts,omitempty"` EncryptedListsOfAddresses map[string][]byte `json:"enc_instances,omitempty"` EncryptedLocalQuery []byte `json:"enc_localquery,omitempty"` EncryptedTargetProfile []byte `json:"enc_operation,omitempty"` EncryptedTargets []byte `json:"enc_addresses,omitempty"` }
QueryDoc saves every information about the query. QueryDoc are saved in the Conductor's database. Thanks to that, CheckPoints can be made, and the process can be followed by the querier.
func NewQuery ¶
func NewQuery(in *query.InputNewQuery) (*QueryDoc, error)
NewQuery returns a Query object to lead, resume, get info about the query.
func NewQueryFetchingQueryDoc ¶
NewQueryFetchingQueryDoc returns a QueryDoc object to resume the request
func (*QueryDoc) Lead ¶
Lead is the most general method. It will use the 5 previous methods to work. Lead can also be used to resume a query thanks to checkpoints.
func (*QueryDoc) ShouldBeComputed ¶
ShouldBeComputed is used by the Conductor to know when to pause/resume/stop the query