BUILD 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 = "model_proto",
  13. srcs = ["model.proto"],
  14. tags = ["automanaged"],
  15. deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
  16. )
  17. go_proto_library(
  18. name = "model_go_proto",
  19. compilers = ["@io_bazel_rules_go//proto:gogofast_proto"],
  20. importpath = "go-common/app/tool/cache/memcached/testdata",
  21. proto = ":model_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 = ["dao_test.go"],
  28. embed = [":go_default_library"],
  29. rundir = ".",
  30. tags = ["automanaged"],
  31. )
  32. go_library(
  33. name = "go_default_library",
  34. srcs = [
  35. "dao.go",
  36. "mc.cache.go",
  37. ],
  38. embed = [":model_go_proto"],
  39. importpath = "go-common/app/tool/cache/memcached/testdata",
  40. tags = ["automanaged"],
  41. visibility = ["//visibility:public"],
  42. deps = [
  43. "//library/cache/memcache:go_default_library",
  44. "//library/container/pool:go_default_library",
  45. "//library/log:go_default_library",
  46. "//library/stat/prom:go_default_library",
  47. "//library/time:go_default_library",
  48. "@com_github_gogo_protobuf//gogoproto:go_default_library",
  49. "@com_github_golang_protobuf//proto:go_default_library",
  50. ],
  51. )
  52. filegroup(
  53. name = "package-srcs",
  54. srcs = glob(["**"]),
  55. tags = ["automanaged"],
  56. visibility = ["//visibility:private"],
  57. )
  58. filegroup(
  59. name = "all-srcs",
  60. srcs = [":package-srcs"],
  61. tags = ["automanaged"],
  62. visibility = ["//visibility:public"],
  63. )