Documentation ¶
Overview ¶
Package oonirelay implements a relay collector that submits sanitized measurements to the OONI Public Collector.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SubmitMeasurement ¶
func SubmitMeasurement(mm *model.Measurement) error
SubmitMeasurement takes a model.Measurement and submits a report to OONI.
Types ¶
type OONIMeasurement ¶
type OONIMeasurement struct { Format string `json:"format"` Content measurementBody `json:"content"` }
type ReportRequest ¶
type ReportRequest struct { DataFormatVersion string `json:"data_format_version"` Format string `json:"format"` ProbeASN string `json:"probe_asn"` ProbeCC string `json:"probe_cc"` SoftwareName string `json:"software_name"` SoftwareVersion string `json:"software_version"` TestName string `json:"test_name"` TestStartTime string `json:"test_start_time"` TestVersion string `json:"test_version"` }
func NewReportRequest ¶
func NewReportRequest() *ReportRequest
NewReportRequest returns a new ReportRequest object.
func (*ReportRequest) JSON ¶
func (rr *ReportRequest) JSON() ([]byte, error)
type ReportSubmitter ¶
func NewReportSubmitter ¶
func NewReportSubmitter() *ReportSubmitter
func (*ReportSubmitter) Close ¶
func (rs *ReportSubmitter) Close() error
Close sends the closing request for this report channel.
func (*ReportSubmitter) SendMeasurement ¶
func (rs *ReportSubmitter) SendMeasurement(m *OONIMeasurement) (string, error)
SendMeasurement tries to send the passed OONIMeasurement. Returns the measurement ID and any error.
func (*ReportSubmitter) Start ¶
func (rs *ReportSubmitter) Start(data []byte) error
Start establishes the report channel, and sets the Report ID after a successful acknowledgement.
Click to show internal directories.
Click to hide internal directories.