Files
beacon-server/internal/api/observer_directory.go
T
MrAlders0n 041d9c1f45 release: v2.0.2
Release the changes on `dev` as v2.0.2: authenticated MeshMapper imports and the traffic-sorted observer directory, including rolling seven-day counts from available history. Bump the API version and regenerate Swagger.

MeshMapper integration requires an API key. Regional admins’ existing per-region or grouped-region coverage keys also work for these APIs. Deployments should set `MESHMAPPER_API_KEY` and restart Beacon.

Validation: `go build ./...`, `gofmt -l .` (empty), `go vet ./...`, `go test ./...`, `govulncheck ./...`, and race tests for MeshMapper and scopestore passed in a clean checkout. PostgreSQL integration tests require CI because Docker is unavailable locally.
2026-10-05 18:35:41 -04:00

49 lines
1.6 KiB
Go

// Copyright 2026 Beacon Contributors
// SPDX-License-Identifier: AGPL-3.0-or-later
package api
type ObserverDirectoryQuery struct {
MatchNone bool
IATAs []string
Type string
Broker string
Status string
Name string
Scope string
Sort string
Since int64
Until int64
Cursor int64
Limit int32
}
type ObserverDirectoryItem struct {
ObserverSummary
// Available observations in [windowStart, windowEnd), including zero with missing history.
ObservationCount *int64 `json:"observationCount"`
}
// Coverage counts intersecting UTC hours. Complete hours use whole-hour rollups;
// partial hours have partial/boundary rollups or available raw observations.
type ObserverDirectoryCoverage struct {
Status string `json:"status"`
ExpectedHours int `json:"expectedHours"`
CompleteHours int `json:"completeHours"`
PartialHours int `json:"partialHours"`
MissingHours int `json:"missingHours"`
}
type ObserverDirectory struct {
Page[ObserverDirectoryItem]
GeneratedAt int64 `json:"generatedAt"`
WindowStart int64 `json:"windowStart"`
WindowEnd int64 `json:"windowEnd"`
Sort string `json:"sort"`
EffectiveSort string `json:"effectiveSort"`
Coverage ObserverDirectoryCoverage `json:"coverage"`
// Maximum over all matching observers, not only this page; zero when none match.
MaxObservationCount *int64 `json:"maxObservationCount"`
ObserverTypes []string `json:"observerTypes"`
}