mirror of
https://github.com/MeshCore-Beacon/beacon-server.git
synced 2026-10-23 08:43:56 +00:00
feat(topology): serve bounded route links and identify decoded Public traffic
This commit is contained in:
1 parent
53f2467864
commit
84ac3c8781
19 files changed
+486
No files matched your search
Vendored
+4
@@ -446,3 +446,7 @@ func TestCachedReader_InvalidateObserver(t *testing.T) {
|
||||
func (s *stubReader) GetRouteEvidence(_ context.Context, _, _ string, _ api.RouteEvidenceQuery) (*api.RouteEvidence, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (s *stubReader) GetTopologyLinks(_ context.Context, _ []string, _ time.Time, _ time.Time) (*api.TopologyLinks, error) {
|
||||
return &api.TopologyLinks{}, nil
|
||||
}
|
||||
Vendored
+9
@@ -378,3 +378,12 @@ func (cr *CachedReader) SearchCrossIATARoutes(ctx context.Context, fromHash, fro
|
||||
func (cr *CachedReader) ListTraceTags(ctx context.Context, iatas []string, scope, traceType string, since, until time.Time, cursor time.Time, cursorTag string, limit int32) ([]api.TraceTagSummary, error) {
|
||||
return cr.inner.ListTraceTags(ctx, iatas, scope, traceType, since, until, cursor, cursorTag, limit)
|
||||
}
|
||||
|
||||
func (cr *CachedReader) GetTopologyLinks(ctx context.Context, iatas []string, since, until time.Time) (*api.TopologyLinks, error) {
|
||||
regions := append([]string{}, iatas...)
|
||||
sort.Strings(regions)
|
||||
key := fmt.Sprintf("beacon:topology:%s:%d:%d", strings.Join(regions, ","), since.Unix(), until.Unix())
|
||||
return getOrSet(ctx, cr.c, key, 30*time.Second, func(ctx context.Context) (*api.TopologyLinks, error) {
|
||||
return cr.inner.GetTopologyLinks(ctx, iatas, since, until)
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user