本站源代码
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

30 lines
747B

  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Copyright 2018 Jonas Franz. All rights reserved.
  3. // Use of this source code is governed by a MIT-style
  4. // license that can be found in the LICENSE file.
  5. package migrations
  6. import (
  7. "errors"
  8. "github.com/google/go-github/v24/github"
  9. )
  10. var (
  11. // ErrNotSupported returns the error not supported
  12. ErrNotSupported = errors.New("not supported")
  13. )
  14. // IsRateLimitError returns true if the err is github.RateLimitError
  15. func IsRateLimitError(err error) bool {
  16. _, ok := err.(*github.RateLimitError)
  17. return ok
  18. }
  19. // IsTwoFactorAuthError returns true if the err is github.TwoFactorAuthError
  20. func IsTwoFactorAuthError(err error) bool {
  21. _, ok := err.(*github.TwoFactorAuthError)
  22. return ok
  23. }
上海开阖软件有限公司 沪ICP备12045867号-1