gitea源码

123456789101112131415161718192021222324252627
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Copyright 2018 Jonas Franz. All rights reserved.
  3. // SPDX-License-Identifier: MIT
  4. package migrations
  5. import (
  6. "errors"
  7. "github.com/google/go-github/v74/github"
  8. )
  9. // ErrRepoNotCreated returns the error that repository not created
  10. var ErrRepoNotCreated = errors.New("repository is not created yet")
  11. // IsRateLimitError returns true if the err is github.RateLimitError
  12. func IsRateLimitError(err error) bool {
  13. _, ok := err.(*github.RateLimitError)
  14. return ok
  15. }
  16. // IsTwoFactorAuthError returns true if the err is github.TwoFactorAuthError
  17. func IsTwoFactorAuthError(err error) bool {
  18. _, ok := err.(*github.TwoFactorAuthError)
  19. return ok
  20. }