Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

32 linhas
1.1 KiB

  1. // Copyright 2022 The Prometheus Authors
  2. // Licensed under the Apache License, Version 2.0 (the "License");
  3. // you may not use this file except in compliance with the License.
  4. // You may obtain a copy of the License at
  5. //
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. package promhttp
  14. // Option are used to configure a middleware or round tripper..
  15. type Option func(*option)
  16. type option struct {
  17. extraMethods []string
  18. }
  19. // WithExtraMethods adds additional HTTP methods to the list of allowed methods.
  20. // See https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods for the default list.
  21. //
  22. // See the example for ExampleInstrumentHandlerWithExtraMethods for example usage.
  23. func WithExtraMethods(methods ...string) Option {
  24. return func(o *option) {
  25. o.extraMethods = methods
  26. }
  27. }