aggregationapi

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package aggregationapi allows one to query the OONI aggregation API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Result ResponseResult `json:"result"`
	V      int64          `json:"v"`
}

Response is the response from the aggregation API.

func Query

func Query(
	ctx context.Context,
	apiURL string,
	inputURL string,
) *Response

Query invokes the aggregation API for the given input URL and returns as the result the API response. This function calls runtimex.PanicOnError in case of failure.

type ResponseResult

type ResponseResult struct {
	AnomalyCount     int64 `json:"anomaly_count"`
	ConfirmedCount   int64 `json:"confirmed_count"`
	FailureCount     int64 `json:"failure_count"`
	MeasurementCount int64 `json:"measurement_count"`
	OKCount          int64 `json:"ok_count"`
}

ResponseResult is the result field inside a Response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL