bgpwtf/cccampix/peeringdb: init
First pass at a proxy to expose PeeringDB data.
Change-Id: I844973755473b3abc5d334586744004b86d1c3a3
diff --git a/bgpwtf/cccampix/proto/BUILD.bazel b/bgpwtf/cccampix/proto/BUILD.bazel
new file mode 100644
index 0000000..023cd8d
--- /dev/null
+++ b/bgpwtf/cccampix/proto/BUILD.bazel
@@ -0,0 +1,23 @@
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
+load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+
+proto_library(
+ name = "ix_proto",
+ srcs = ["ix.proto"],
+ visibility = ["//visibility:public"],
+)
+
+go_proto_library(
+ name = "ix_go_proto",
+ compilers = ["@io_bazel_rules_go//proto:go_grpc"],
+ importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/proto",
+ proto = ":ix_proto",
+ visibility = ["//visibility:public"],
+)
+
+go_library(
+ name = "go_default_library",
+ embed = [":ix_go_proto"],
+ importpath = "code.hackerspace.pl/hscloud/bgpwtf/cccampix/proto",
+ visibility = ["//visibility:public"],
+)
diff --git a/bgpwtf/cccampix/proto/ix.proto b/bgpwtf/cccampix/proto/ix.proto
new file mode 100644
index 0000000..73bc4d1
--- /dev/null
+++ b/bgpwtf/cccampix/proto/ix.proto
@@ -0,0 +1,26 @@
+syntax = "proto3";
+package ix;
+
+message GetIXMembersRequest {
+ // IX ID from PeeringDB
+ int64 id = 1;
+}
+
+message GetIXMembersResponse {
+ message Member {
+ int64 asn = 1;
+ // Per PeeringDB, at least one of the following two address families
+ // will be set.
+ string ipv4 = 2;
+ string ipv6 = 3;
+ // AS/network name.
+ string name = 4;
+ };
+
+ repeated Member members = 1;
+}
+
+service PeeringDBProxy {
+ // GetIXMembers returns information about membership of a given PeeringDB IX.
+ rpc GetIXMembers(GetIXMembersRequest) returns (GetIXMembersResponse);
+}