[READ ONLY MIRROR] Envoy REST/proto API definitions and documentation. (grpc依赖)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

226 lines
6.4 KiB

GOOGLEAPIS_SHA = "5c6df0cd18c6a429eab739fb711c27f6e1393366" # May 14, 2017
GOGOPROTO_SHA = "342cbe0a04158f6dcb03ca0079991a51a4248c02" # Oct 7, 2017
PROMETHEUS_SHA = "6f3806018612930941127f2a7c6c453ba2c527d2" # Nov 02, 2017
OPENCENSUS_SHA = "993c711ba22a5f08c1d4de58a3c07466995ed962" # Dec 13, 2017
PGV_GIT_SHA = "3204975f8145b7d187081b7034060012ae838d17"
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
def api_dependencies():
git_repository(
name = "com_lyft_protoc_gen_validate",
remote = "https://github.com/lyft/protoc-gen-validate.git",
commit = PGV_GIT_SHA,
)
native.new_http_archive(
name = "googleapis",
strip_prefix = "googleapis-" + GOOGLEAPIS_SHA,
url = "https://github.com/googleapis/googleapis/archive/" + GOOGLEAPIS_SHA + ".tar.gz",
build_file_content = """
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library", "py_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
filegroup(
name = "http_api_protos_src",
srcs = [
"google/api/annotations.proto",
"google/api/http.proto",
],
visibility = ["//visibility:public"],
)
go_proto_library(
name = "descriptor_go_proto",
importpath = "github.com/golang/protobuf/protoc-gen-go/descriptor",
proto = "@com_google_protobuf//:descriptor_proto",
visibility = ["//visibility:public"],
)
proto_library(
name = "http_api_protos_proto",
srcs = [":http_api_protos_src"],
deps = ["@com_google_protobuf//:descriptor_proto"],
visibility = ["//visibility:public"],
)
cc_proto_library(
name = "http_api_protos",
srcs = [
"google/api/annotations.proto",
"google/api/http.proto",
],
default_runtime = "@com_google_protobuf//:protobuf",
protoc = "@com_google_protobuf//:protoc",
deps = ["@com_google_protobuf//:cc_wkt_protos"],
visibility = ["//visibility:public"],
)
py_proto_library(
name = "http_api_protos_py",
srcs = [
"google/api/annotations.proto",
"google/api/http.proto",
],
include = ".",
default_runtime = "@com_google_protobuf//:protobuf_python",
protoc = "@com_google_protobuf//:protoc",
visibility = ["//visibility:public"],
deps = ["@com_google_protobuf//:protobuf_python"],
)
go_proto_library(
name = "http_api_go_proto",
importpath = "google.golang.org/genproto/googleapis/api/annotations",
proto = ":http_api_protos_proto",
visibility = ["//visibility:public"],
deps = [
":descriptor_go_proto",
],
)
filegroup(
name = "rpc_status_protos_src",
srcs = [
"google/rpc/status.proto",
],
visibility = ["//visibility:public"],
)
proto_library(
name = "rpc_status_protos_lib",
srcs = [":rpc_status_protos_src"],
deps = ["@com_google_protobuf//:any_proto"],
visibility = ["//visibility:public"],
)
cc_proto_library(
name = "rpc_status_protos",
srcs = ["google/rpc/status.proto"],
default_runtime = "@com_google_protobuf//:protobuf",
protoc = "@com_google_protobuf//:protoc",
deps = [
"@com_google_protobuf//:cc_wkt_protos"
],
visibility = ["//visibility:public"],
)
go_proto_library(
name = "rpc_status_go_proto",
importpath = "google.golang.org/genproto/googleapis/rpc/status",
proto = ":rpc_status_protos_lib",
visibility = ["//visibility:public"],
deps = [
"@com_github_golang_protobuf//ptypes/any:go_default_library",
],
)
py_proto_library(
name = "rpc_status_protos_py",
srcs = [
"google/rpc/status.proto",
],
include = ".",
default_runtime = "@com_google_protobuf//:protobuf_python",
protoc = "@com_google_protobuf//:protoc",
visibility = ["//visibility:public"],
deps = ["@com_google_protobuf//:protobuf_python"],
)
""",
)
native.new_http_archive(
name = "com_github_gogo_protobuf",
strip_prefix = "protobuf-" + GOGOPROTO_SHA,
url = "https://github.com/gogo/protobuf/archive/" + GOGOPROTO_SHA + ".tar.gz",
build_file_content = """
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library", "py_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
proto_library(
name = "gogo_proto",
srcs = [
"gogoproto/gogo.proto",
],
deps = [
"@com_google_protobuf//:descriptor_proto",
],
visibility = ["//visibility:public"],
)
go_proto_library(
name = "descriptor_go_proto",
importpath = "github.com/golang/protobuf/protoc-gen-go/descriptor",
proto = "@com_google_protobuf//:descriptor_proto",
visibility = ["//visibility:public"],
)
cc_proto_library(
name = "gogo_proto_cc",
srcs = [
"gogoproto/gogo.proto",
],
default_runtime = "@com_google_protobuf//:protobuf",
protoc = "@com_google_protobuf//:protoc",
deps = ["@com_google_protobuf//:cc_wkt_protos"],
visibility = ["//visibility:public"],
)
go_proto_library(
name = "gogo_proto_go",
importpath = "gogoproto",
proto = ":gogo_proto",
visibility = ["//visibility:public"],
deps = [
":descriptor_go_proto",
],
)
py_proto_library(
name = "gogo_proto_py",
srcs = [
"gogoproto/gogo.proto",
],
default_runtime = "@com_google_protobuf//:protobuf_python",
protoc = "@com_google_protobuf//:protoc",
visibility = ["//visibility:public"],
deps = ["@com_google_protobuf//:protobuf_python"],
)
""",
)
native.new_http_archive(
name = "promotheus_metrics_model",
strip_prefix = "client_model-" + PROMETHEUS_SHA,
url = "https://github.com/prometheus/client_model/archive/" + PROMETHEUS_SHA + ".tar.gz",
build_file_content = """
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library")
api_proto_library(
name = "client_model",
srcs = [
"metrics.proto",
],
visibility = ["//visibility:public"],
)
""",
)
native.new_http_archive(
name = "io_opencensus_trace",
strip_prefix = "opencensus-proto-" + OPENCENSUS_SHA + "/opencensus/proto/trace",
url = "https://github.com/census-instrumentation/opencensus-proto/archive/" + OPENCENSUS_SHA + ".tar.gz",
build_file_content = """
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_library")
api_proto_library(
name = "trace_model",
srcs = [
"trace.proto",
],
visibility = ["//visibility:public"],
)
""",
)