Documentation ¶
Index ¶
- Variables
- func ConceptsToString(concepts []Concept) string
- func DeleteAsyncDataT(queryid string) error
- func FetchAsyncDataDA(queryid string, indexLayer int, indexDA int) (map[string]interface{}, error)
- func FetchAsyncDataT(queryid string) (map[string]interface{}, error)
- func FetchAsyncMetadata(queryid string) ([]metadata.TaskMetadata, error)
- func IsAsyncTaskDAExisting(queryid string, indexLayer int, indexDA int) (bool, error)
- type AggregationFunction
- type AggregationJob
- type AggregationPatch
- type AsyncTask
- func (as *AsyncTask) Clone() couchdb.Doc
- func (as *AsyncTask) DocType() string
- func (as *AsyncTask) GetStateDA() State
- func (as *AsyncTask) ID() string
- func (as *AsyncTask) Rev() string
- func (as *AsyncTask) SetData(data ...map[string]interface{}) error
- func (as *AsyncTask) SetFinished() error
- func (as *AsyncTask) SetID(id string)
- func (as *AsyncTask) SetRev(rev string)
- type AsyncType
- type Concept
- type FindParams
- type InputCI
- type InputDA
- type InputNewQuery
- type InputPatchQuery
- type InputT
- type InputTF
- type Instance
- type LayerDA
- type LocalQuery
- type NodeType
- type OperationTree
- type OutputCI
- type OutputDA
- type OutputT
- type OutputTF
- type StackQuery
- type State
Constants ¶
This section is empty.
Variables ¶
var AsyncTypes = []string{"AsyncAggregation"}
var PrefixerC = prefixer.ConductorPrefixer
var PrefixerT = prefixer.TargetPrefixer
Functions ¶
func ConceptsToString ¶
func DeleteAsyncDataT ¶
func FetchAsyncDataDA ¶
func FetchAsyncDataT ¶
func FetchAsyncMetadata ¶
func FetchAsyncMetadata(queryid string) ([]metadata.TaskMetadata, error)
Types ¶
type AggregationFunction ¶
type AggregationFunction struct { Function string `json:"func,omitempty"` Args map[string]interface{} `json:"args,omitempty"` }
AggregationFunction is created by DA from AggregationJob
type AggregationJob ¶
type AggregationJob struct { Job string `json:"job,omitempty"` Args map[string]interface{} `json:"args,omitempty"` }
AggregationJob is transmitted by the Querier
type AggregationPatch ¶
type AggregationPatch struct { Patch string `json:"patch,omitempty"` Args map[string]interface{} `json:"args,omitempty"` }
AggregationPatch is created by DA from AggregationJob
type AsyncTask ¶
type AsyncTask struct { AsyncID string `json:"_id,omitempty"` AsyncRev string `json:"_rev,omitempty"` AsyncType AsyncType `json:"async_type,omitempty"` QueryID string `json:"query_id"` TaskMetadata metadata.TaskMetadata `json:"task_metadata"` // Attributes used for AsyncAggregation IndexLayer int `json:"da_layer_id"` IndexDA int `json:"da_id"` StateDA State `json:"da_state,omitempty"` ResultDA map[string]interface{} `json:"da_result,omitempty"` // Attributes used for AsyncQueryTarget or AsyncSendData NumberOfTargets int `json:"t_number_targets,omitempty"` Data []map[string]interface{} `json:"t_data,omitempty"` }
func NewAsyncTask ¶
func RetrieveAsyncTaskDA ¶
func (*AsyncTask) GetStateDA ¶
GetStateDA returns the state of DA
func (*AsyncTask) SetFinished ¶
type FindParams ¶
type FindParams struct { Selector map[string]interface{} `json:"selector"` Skip int `json:"skip,omitempty"` Limit int `json:"limit,omitempty"` Sort []map[string]string `json:"sort,omitempty"` }
FindParams describes to query to make to stacks It follows CouchDB conventions
type InputDA ¶
type InputDA struct { QueryID string `json:"queryid"` AggregationID [2]int `json:"aggregationid,omitempty"` ConductorURL url.URL `json:"conductor_url"` IsEncrypted bool `json:"is_encrypted"` EncryptedJobs []byte `json:"enc_jobs,omitempty"` EncryptedData []byte `json:"enc_data,omitempty"` TaskMetadata metadata.TaskMetadata `json:"metadata_task,omitempty"` }
type InputNewQuery ¶
type InputNewQuery struct { Concepts []string `json:"concepts,omitempty"` PseudoConcepts map[string]string `json:"pseudo_concepts,omitempty"` IsEncrypted bool `json:"is_encrypted"` LocalQuery LocalQuery `json:"local_query,omitempty"` TargetProfile string `json:"target_profile,omitempty"` LayersDA []LayerDA `json:"layers_da,omitempty"` EncryptedLocalQuery []byte `json:"enc_local_query,omitempty"` EncryptedConcepts []Concept `json:"enc_concepts,omitempty"` EncryptedTargetProfile []byte `json:"enc_operation,omitempty"` }
type InputPatchQuery ¶
type InputT ¶
type InputT struct { IsEncrypted bool `json:"is_encrypted,omitempty"` EncryptedLocalQuery []byte `json:"enc_local_query,omitempty"` EncryptedTargets []byte `json:"enc_addresses,omitempty"` ConductorURL url.URL `json:"conductor_url"` QueryID string `json:"queryid,omitempty"` TaskMetadata metadata.TaskMetadata `json:"metadata_task,omitempty"` }
InputT contains information received by Target's enclave
type InputTF ¶
type InputTF struct { IsEncrypted bool `json:"is_encrypted"` EncryptedListsOfAddresses map[string][]byte `json:"enc_instances,omitempty"` EncryptedTargetProfile []byte `json:"enc_operation,omitempty"` TaskMetadata metadata.TaskMetadata `json:"metadata_task,omitempty"` }
InputTF contains a map that associate every concept to a list of Addresses and a operation to compute to retrive the final list
type Instance ¶
type Instance struct { Domain string `json:"domain"` TokenBearer string `json:"token_bearer"` Version int `json:"version"` }
Instance describes the location of an instance and the token it had created When Target received twice the same Instance, it needs to be able to consider the more recent item
type LayerDA ¶
type LayerDA struct { Data []map[string]interface{} `json:"layer_data,omitempty"` Size int `json:"layer_size"` EncryptedJobs []byte `json:"layer_enc_jobs"` Jobs []AggregationJob `json:"layer_jobs"` }
type LocalQuery ¶
type LocalQuery struct { FindRequest FindParams `json:"findrequest"` Doctype string `json:"doctype"` Index map[string]interface{} `json:"index"` Limit int `json:"limit,omitempty"` }
LocalQuery decribes which data the stack has to retrieve
type OperationTree ¶
type OperationTree struct { Type NodeType `json:"type"` Value string `json:"value,omitempty"` LeftNode interface{} `json:"left_node,omitempty"` RightNode interface{} `json:"right_node,omitempty"` }
OperationTree allows the possibility to compute target profiles in a recursive way. OperationTree contains SingleNode, OrNode, AndNode SingleNodes have got a value field. A value is the name of a list of strings To compute the OperationTree, Compute method needs a map that matches names with list of encrypted addresses.
func (*OperationTree) Compute ¶
func (o *OperationTree) Compute(listsOfAddresses map[string][]string) ([]string, error)
Compute compute the OperationTree and returns the list of encrypted addresses
func (*OperationTree) UnmarshalJSON ¶
func (o *OperationTree) UnmarshalJSON(data []byte) error
UnmarshalJSON is used to load the OperationTree given by the Querier
type OutputCI ¶
type OutputCI struct { Hashes []Concept `json:"hashes,omitempty"` TaskMetadata metadata.TaskMetadata `json:"metadata_task,omitempty"` }
OutputCI contains a bool and the result
type OutputDA ¶
type OutputDA struct { Results map[string]interface{} `json:"results,omitempty"` QueryID string `json:"queryid,omitempty"` AggregationID [2]int `json:"aggregationid,omitempty"` TaskMetadata metadata.TaskMetadata `json:"metadata_task,omitempty"` }
type OutputT ¶
type OutputT struct { Data []map[string]interface{} `json:"data,omitempty"` QueryID string `json:"queryid,omitempty"` TaskMetadata metadata.TaskMetadata `json:"metadata_task,omitempty"` }
OutputT is what Target returns to the conductor
type OutputTF ¶
type OutputTF struct { EncryptedTargets []byte `json:"enc_targets,omitempty"` TaskMetadata metadata.TaskMetadata `json:"metadata_task,omitempty"` }
OutputTF is what Target Finder send to the conductor
type StackQuery ¶
type StackQuery struct { Domain string `json:"domain"` LocalQuery LocalQuery `json:"local_query"` TokenBearer string `json:"token_bearer"` IsEncrypted bool `json:"is_encrypted"` ConductorURL url.URL `json:"conductor_url"` QueryID string `json:"queryid"` NumberOfTargets int `json:"number_targets"` }
StackQuery is all the information needed by the conductor's and stack to make a query