Add go generation rules (#204)

Signed-off-by: Kuat Yessenov <kuat@google.com>
pull/207/head
Kuat 7 years ago committed by htuch
parent f2c1dc99df
commit a039871337
  1. 3
      BUILD
  2. 10
      WORKSPACE
  3. 49
      api/BUILD
  4. 1
      api/base.proto
  5. 23
      api/filter/BUILD
  6. 1
      api/filter/fault.proto
  7. 45
      api/filter/http/BUILD
  8. 1
      api/filter/http/http_connection_manager.proto
  9. 42
      api/filter/network/BUILD
  10. 1
      api/filter/network/tcp_proxy.proto
  11. 9
      bazel/repositories.bzl

@ -0,0 +1,3 @@
load("@io_bazel_rules_go//go:def.bzl", "go_prefix")
go_prefix("github.com/envoyproxy/data-plane-api")

@ -36,3 +36,13 @@ new_http_archive(
url = "https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55",
)
git_repository(
name = "io_bazel_rules_go",
remote = "https://github.com/bazelbuild/rules_go.git",
commit = "4374be38e9a75ff5957c3922adb155d32086fe14",
)
load("@io_bazel_rules_go//go:def.bzl", "go_rules_dependencies", "go_register_toolchains")
go_rules_dependencies()
go_register_toolchains()
load("@io_bazel_rules_go//proto:def.bzl", "proto_register_toolchains")
proto_register_toolchains()

@ -1,7 +1,54 @@
load("//bazel:api_build_system.bzl", "api_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_grpc_library")
licenses(["notice"]) # Apache 2
# Go proto library dislikes proto libraries with no sources and only deps
proto_library(
name = "go_protos",
srcs = [
"accesslog.proto",
"address.proto",
"base.proto",
"bootstrap.proto",
"cds.proto",
"discovery.proto",
"eds.proto",
"hds.proto",
"health_check.proto",
"lds.proto",
"protocol.proto",
"rds.proto",
"rls.proto",
"sds.proto",
],
visibility = ["//visibility:public"],
deps = [
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"@googleapis//:http_api_protos_lib",
],
)
go_grpc_library(
name = "go_default_library",
importpath = "api",
proto = ":go_protos",
visibility = ["//visibility:public"],
deps = [
"@com_github_golang_protobuf//ptypes/any:go_default_library",
"@com_github_golang_protobuf//ptypes/duration:go_default_library",
"@com_github_golang_protobuf//ptypes/struct:go_default_library",
"@com_github_golang_protobuf//ptypes/timestamp:go_default_library",
"@com_github_golang_protobuf//ptypes/wrappers:go_default_library",
"@org_golang_google_genproto//googleapis/api/annotations:go_default_library",
],
)
api_proto_library(
name = "address",
srcs = ["address.proto"],
@ -124,7 +171,7 @@ proto_library(
deps = [
":cds",
":eds",
":rds",
":lds",
":rds",
],
)

@ -1,6 +1,7 @@
syntax = "proto3";
package envoy.api.v2;
option go_package = "api";
import "api/address.proto";

@ -1,7 +1,30 @@
load("//bazel:api_build_system.bzl", "api_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
licenses(["notice"]) # Apache 2
# Go proto library dislikes proto libraries with no sources and only deps
proto_library(
name = "go_protos",
srcs = [
"fault.proto",
],
visibility = ["//visibility:public"],
deps = [
"@com_google_protobuf//:duration_proto",
],
)
go_proto_library(
name = "go_default_library",
importpath = "api/filter",
proto = ":go_protos",
visibility = ["//visibility:public"],
deps = [
"@com_github_golang_protobuf//ptypes/duration:go_default_library",
],
)
api_proto_library(
name = "fault",
srcs = ["fault.proto"],

@ -1,6 +1,7 @@
syntax = "proto3";
package envoy.api.v2.filter;
option go_package = "filter";
import "google/protobuf/duration.proto";

@ -1,7 +1,52 @@
load("//bazel:api_build_system.bzl", "api_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
licenses(["notice"]) # Apache 2
# Go proto library dislikes proto libraries with no sources and only deps
proto_library(
name = "go_protos",
srcs = [
"buffer.proto",
"fault.proto",
"health_check.proto",
"http_connection_manager.proto",
"ip_tagging.proto",
"rate_limit.proto",
"router.proto",
"transcoder.proto",
],
visibility = ["//visibility:public"],
deps = [
"//api:go_protos",
"//api/filter:go_protos",
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"@googleapis//:http_api_protos_lib",
],
)
go_proto_library(
name = "go_default_library",
importpath = "api/filter/http",
proto = ":go_protos",
visibility = ["//visibility:public"],
deps = [
"//api:go_default_library",
"//api/filter:go_default_library",
"@com_github_golang_protobuf//ptypes/any:go_default_library",
"@com_github_golang_protobuf//ptypes/duration:go_default_library",
"@com_github_golang_protobuf//ptypes/struct:go_default_library",
"@com_github_golang_protobuf//ptypes/timestamp:go_default_library",
"@com_github_golang_protobuf//ptypes/wrappers:go_default_library",
"@org_golang_google_genproto//googleapis/api/annotations:go_default_library",
],
)
api_proto_library(
name = "http_connection_manager",
srcs = ["http_connection_manager.proto"],

@ -1,6 +1,7 @@
syntax = "proto3";
package envoy.api.v2.filter.http;
option go_package = "http";
import "api/base.proto";
import "api/protocol.proto";

@ -1,7 +1,49 @@
load("//bazel:api_build_system.bzl", "api_proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
licenses(["notice"]) # Apache 2
# Go proto library dislikes proto libraries with no sources and only deps
proto_library(
name = "go_protos",
srcs = [
"client_ssl_auth.proto",
"mongo_proxy.proto",
"rate_limit.proto",
"redis_proxy.proto",
"tcp_proxy.proto",
],
visibility = ["//visibility:public"],
deps = [
"//api:go_protos",
"//api/filter:go_protos",
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:wrappers_proto",
"@googleapis//:http_api_protos_lib",
],
)
go_proto_library(
name = "go_default_library",
importpath = "api/filter/network",
proto = ":go_protos",
visibility = ["//visibility:public"],
deps = [
"//api:go_default_library",
"//api/filter:go_default_library",
"@com_github_golang_protobuf//ptypes/any:go_default_library",
"@com_github_golang_protobuf//ptypes/duration:go_default_library",
"@com_github_golang_protobuf//ptypes/struct:go_default_library",
"@com_github_golang_protobuf//ptypes/timestamp:go_default_library",
"@com_github_golang_protobuf//ptypes/wrappers:go_default_library",
"@org_golang_google_genproto//googleapis/api/annotations:go_default_library",
],
)
api_proto_library(
name = "mongo_proxy",
srcs = ["mongo_proxy.proto"],

@ -1,6 +1,7 @@
syntax = "proto3";
package envoy.api.v2.filter.network;
option go_package = "network";
import "google/protobuf/duration.proto";

@ -1,9 +1,10 @@
GOOGLEAPIS_SHA = "5c6df0cd18c6a429eab739fb711c27f6e1393366" # May 14, 2017
def api_dependencies():
native.new_git_repository(
native.new_http_archive(
name = "googleapis",
# Head of master at 5/14.
commit = "5c6df0cd18c6a429eab739fb711c27f6e1393366",
remote = "https://github.com/googleapis/googleapis.git",
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", "py_proto_library")

Loading…
Cancel
Save