path_funcs.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // Copyright 2018 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // https://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package logging
  15. // ConfigProjectPath returns the path for the project resource.
  16. //
  17. // Deprecated: Use
  18. //
  19. // fmt.Sprintf("projects/%s", project)
  20. //
  21. // instead.
  22. func ConfigProjectPath(project string) string {
  23. return "" +
  24. "projects/" +
  25. project +
  26. ""
  27. }
  28. // ConfigSinkPath returns the path for the sink resource.
  29. //
  30. // Deprecated: Use
  31. //
  32. // fmt.Sprintf("projects/%s/sinks/%s", project, sink)
  33. //
  34. // instead.
  35. func ConfigSinkPath(project, sink string) string {
  36. return "" +
  37. "projects/" +
  38. project +
  39. "/sinks/" +
  40. sink +
  41. ""
  42. }
  43. // ConfigExclusionPath returns the path for the exclusion resource.
  44. //
  45. // Deprecated: Use
  46. //
  47. // fmt.Sprintf("projects/%s/exclusions/%s", project, exclusion)
  48. //
  49. // instead.
  50. func ConfigExclusionPath(project, exclusion string) string {
  51. return "" +
  52. "projects/" +
  53. project +
  54. "/exclusions/" +
  55. exclusion +
  56. ""
  57. }
  58. // ProjectPath returns the path for the project resource.
  59. //
  60. // Deprecated: Use
  61. //
  62. // fmt.Sprintf("projects/%s", project)
  63. //
  64. // instead.
  65. func ProjectPath(project string) string {
  66. return "" +
  67. "projects/" +
  68. project +
  69. ""
  70. }
  71. // LogPath returns the path for the log resource.
  72. //
  73. // Deprecated: Use
  74. //
  75. // fmt.Sprintf("projects/%s/logs/%s", project, log)
  76. //
  77. // instead.
  78. func LogPath(project, log string) string {
  79. return "" +
  80. "projects/" +
  81. project +
  82. "/logs/" +
  83. log +
  84. ""
  85. }
  86. // MetricsProjectPath returns the path for the project resource.
  87. //
  88. // Deprecated: Use
  89. //
  90. // fmt.Sprintf("projects/%s", project)
  91. //
  92. // instead.
  93. func MetricsProjectPath(project string) string {
  94. return "" +
  95. "projects/" +
  96. project +
  97. ""
  98. }
  99. // MetricsMetricPath returns the path for the metric resource.
  100. //
  101. // Deprecated: Use
  102. //
  103. // fmt.Sprintf("projects/%s/metrics/%s", project, metric)
  104. //
  105. // instead.
  106. func MetricsMetricPath(project, metric string) string {
  107. return "" +
  108. "projects/" +
  109. project +
  110. "/metrics/" +
  111. metric +
  112. ""
  113. }