BUILD 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. load(
  2. "@io_bazel_rules_go//proto:def.bzl",
  3. "go_proto_library",
  4. )
  5. package(default_visibility = ["//visibility:public"])
  6. load(
  7. "@io_bazel_rules_go//go:def.bzl",
  8. "go_test",
  9. "go_library",
  10. )
  11. proto_library(
  12. name = "cache_proto",
  13. srcs = ["page.proto"],
  14. tags = ["automanaged"],
  15. deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
  16. )
  17. go_proto_library(
  18. name = "cache_go_proto",
  19. compilers = ["@io_bazel_rules_go//proto:gogofast_proto"],
  20. importpath = "go-common/library/net/http/blademaster/middleware/cache",
  21. proto = ":cache_proto",
  22. tags = ["automanaged"],
  23. deps = ["@com_github_gogo_protobuf//gogoproto:go_default_library"],
  24. )
  25. go_test(
  26. name = "go_default_test",
  27. srcs = ["cache_test.go"],
  28. embed = [":go_default_library"],
  29. rundir = ".",
  30. tags = ["automanaged"],
  31. deps = [
  32. "//library/cache/memcache:go_default_library",
  33. "//library/container/pool:go_default_library",
  34. "//library/ecode:go_default_library",
  35. "//library/log:go_default_library",
  36. "//library/net/http/blademaster:go_default_library",
  37. "//library/net/http/blademaster/middleware/cache/store:go_default_library",
  38. "//library/time:go_default_library",
  39. "//vendor/github.com/stretchr/testify/assert:go_default_library",
  40. ],
  41. )
  42. go_library(
  43. name = "go_default_library",
  44. srcs = [
  45. "cache.go",
  46. "control.go",
  47. "degrade.go",
  48. "page.go",
  49. ],
  50. embed = [":cache_go_proto"],
  51. importpath = "go-common/library/net/http/blademaster/middleware/cache",
  52. tags = ["automanaged"],
  53. visibility = ["//visibility:public"],
  54. deps = [
  55. "//library/ecode:go_default_library",
  56. "//library/log:go_default_library",
  57. "//library/net/http/blademaster:go_default_library",
  58. "//library/net/http/blademaster/middleware/cache/store:go_default_library",
  59. "@com_github_gogo_protobuf//gogoproto:go_default_library",
  60. "@com_github_gogo_protobuf//proto:go_default_library",
  61. ],
  62. )
  63. go_test(
  64. name = "go_default_xtest",
  65. srcs = ["example_test.go"],
  66. tags = ["automanaged"],
  67. deps = [
  68. "//library/cache/memcache:go_default_library",
  69. "//library/container/pool:go_default_library",
  70. "//library/ecode:go_default_library",
  71. "//library/net/http/blademaster:go_default_library",
  72. "//library/net/http/blademaster/middleware/cache:go_default_library",
  73. "//library/net/http/blademaster/middleware/cache/store:go_default_library",
  74. "//library/time:go_default_library",
  75. "//vendor/github.com/pkg/errors:go_default_library",
  76. ],
  77. )
  78. filegroup(
  79. name = "package-srcs",
  80. srcs = glob(["**"]),
  81. tags = ["automanaged"],
  82. visibility = ["//visibility:private"],
  83. )
  84. filegroup(
  85. name = "all-srcs",
  86. srcs = [
  87. ":package-srcs",
  88. "//library/net/http/blademaster/middleware/cache/store:all-srcs",
  89. ],
  90. tags = ["automanaged"],
  91. visibility = ["//visibility:public"],
  92. )