-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
snet: make PathMetadata a struct (#3923)
Make `snet.PathMetadata` a struct instead of an interface. Analogous to how this was done for `snet.PathInterface` (#3879). The indirection with an interface is simply unnecessary. Making this a struct, will allow to extend the `PathMetadata` struct quite easily: in a next PR, we'll add the latency, bandwidth, geo coordinates etc. from the "static info" beaconing extension (currently, these fields are defined in a shadow copy of `PathMetadata` in `combinator/staticinfo_accumulator.go`). Move `Interfaces` to `snet.PathMetadata`. The `Interfaces` list is available exactly if the other metadata items are available, so it makes sense to bundle these. This requires/brings some changes to `pathpol.PathSet` -- now the pathpol is fed directly with the `snet.PathMetadata` struct. This seems quite natural, as it's conceivable that the path policy would access all the various metadata items in the future. This change also requires some minor adjustments at the call sites for the path policies.
- Loading branch information
Showing
40 changed files
with
178 additions
and
642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,13 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = [ | ||
"filter.go", | ||
"router.go", | ||
], | ||
srcs = ["router.go"], | ||
importpath = "github.com/scionproto/scion/go/cs/segutil", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//go/lib/addr:go_default_library", | ||
"//go/lib/common:go_default_library", | ||
"//go/lib/ctrl/seg:go_default_library", | ||
"//go/lib/infra/modules/segfetcher:go_default_library", | ||
"//go/lib/pathpol:go_default_library", | ||
"//go/lib/snet:go_default_library", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "go_default_test", | ||
srcs = ["filter_test.go"], | ||
embed = [":go_default_library"], | ||
deps = [ | ||
"//go/cs/segutil/mock_segutil:go_default_library", | ||
"//go/lib/common:go_default_library", | ||
"//go/lib/ctrl/seg:go_default_library", | ||
"//go/lib/pathpol:go_default_library", | ||
"//go/lib/xtest/graph:go_default_library", | ||
"@com_github_golang_mock//gomock:go_default_library", | ||
"@com_github_stretchr_testify//assert:go_default_library", | ||
], | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.