pmpresultcode_string.go 1015 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (c) Tailscale Inc & AUTHORS
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. // Code generated by "stringer -type=pmpResultCode -trimprefix=pmpCode"; DO NOT EDIT.
  4. package portmapper
  5. import "strconv"
  6. func _() {
  7. // An "invalid array index" compiler error signifies that the constant values have changed.
  8. // Re-run the stringer command to generate them again.
  9. var x [1]struct{}
  10. _ = x[pmpCodeOK-0]
  11. _ = x[pmpCodeUnsupportedVersion-1]
  12. _ = x[pmpCodeNotAuthorized-2]
  13. _ = x[pmpCodeNetworkFailure-3]
  14. _ = x[pmpCodeOutOfResources-4]
  15. _ = x[pmpCodeUnsupportedOpcode-5]
  16. }
  17. const _pmpResultCode_name = "OKUnsupportedVersionNotAuthorizedNetworkFailureOutOfResourcesUnsupportedOpcode"
  18. var _pmpResultCode_index = [...]uint8{0, 2, 20, 33, 47, 61, 78}
  19. func (i pmpResultCode) String() string {
  20. idx := int(i) - 0
  21. if i < 0 || idx >= len(_pmpResultCode_index)-1 {
  22. return "pmpResultCode(" + strconv.FormatInt(int64(i), 10) + ")"
  23. }
  24. return _pmpResultCode_name[_pmpResultCode_index[idx]:_pmpResultCode_index[idx+1]]
  25. }