Documentation
¶
Index ¶
- type AnalyzeJob
- type AnalyzeResult
- type QueryLanguage
- type Queue
- type QueueSingle
- type RabbitMQQueue
- func (q *RabbitMQQueue) Close()
- func (q *RabbitMQQueue) ConsumeJobs(queueName string)
- func (q *RabbitMQQueue) ConsumeResults(queueName string)
- func (q *RabbitMQQueue) Jobs() chan AnalyzeJob
- func (q *RabbitMQQueue) PublishJobs(queueName string)
- func (q *RabbitMQQueue) PublishResults(queueName string)
- func (q *RabbitMQQueue) Results() chan AnalyzeResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalyzeJob ¶
type AnalyzeJob struct { Spec common.JobSpec // json:"job_spec" QueryPackLocation artifactstore.ArtifactLocation // json:"query_pack_location" QueryLanguage QueryLanguage // json:"query_language" }
AnalyzeJob represents a job specifying a repository and a query pack to analyze it with. This is the message format that the agent receives from the queue. TODO: make query_pack_location query_pack_url with a presigned URL
type AnalyzeResult ¶
type AnalyzeResult struct { Spec common.JobSpec // json:"job_spec" Status common.Status // json:"status" ResultCount int // json:"result_count" ResultLocation artifactstore.ArtifactLocation // json:"result_location" SourceLocationPrefix string // json:"source_location_prefix" DatabaseSHA string // json:"database_sha" }
AnalyzeResult represents the result of an analysis job. This is the message format that the agent sends to the queue. Status will only ever be StatusSuccess or StatusError when sent in a result. TODO: make result_location result_archive_url with a presigned URL
type QueryLanguage ¶
type QueryLanguage string
type Queue ¶
type Queue interface { Jobs() chan AnalyzeJob Results() chan AnalyzeResult Close() }
func NewQueueSingle ¶
type QueueSingle ¶
type QueueSingle struct { NumWorkers int // contains filtered or unexported fields }
func (QueueSingle) Close ¶
func (q QueueSingle) Close()
func (QueueSingle) Jobs ¶
func (q QueueSingle) Jobs() chan AnalyzeJob
func (QueueSingle) Results ¶
func (q QueueSingle) Results() chan AnalyzeResult
type RabbitMQQueue ¶
type RabbitMQQueue struct {
// contains filtered or unexported fields
}
func NewRabbitMQQueue ¶
func NewRabbitMQQueue( host string, port int16, user string, password string, isAgent bool, ) (*RabbitMQQueue, error)
NewRabbitMQQueue initializes a RabbitMQ queue. It returns a pointer to a RabbitMQQueue and an error.
If isAgent is true, the queue is initialized to be used by an agent. Otherwise, the queue is initialized to be used by the server. The difference in behaviour is that the agent consumes jobs and publishes results, while the server publishes jobs and consumes results.
func (*RabbitMQQueue) Close ¶
func (q *RabbitMQQueue) Close()
func (*RabbitMQQueue) ConsumeJobs ¶
func (q *RabbitMQQueue) ConsumeJobs(queueName string)
func (*RabbitMQQueue) ConsumeResults ¶
func (q *RabbitMQQueue) ConsumeResults(queueName string)
func (*RabbitMQQueue) Jobs ¶
func (q *RabbitMQQueue) Jobs() chan AnalyzeJob
func (*RabbitMQQueue) PublishJobs ¶
func (q *RabbitMQQueue) PublishJobs(queueName string)
func (*RabbitMQQueue) PublishResults ¶
func (q *RabbitMQQueue) PublishResults(queueName string)
func (*RabbitMQQueue) Results ¶
func (q *RabbitMQQueue) Results() chan AnalyzeResult