You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

error.go 37 kB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
9 years ago
9 years ago
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
8 years ago
Oauth2 consumer (#679) * initial stuff for oauth2 login, fails on: * login button on the signIn page to start the OAuth2 flow and a callback for each provider Only GitHub is implemented for now * show login button only when the OAuth2 consumer is configured (and activated) * create macaron group for oauth2 urls * prevent net/http in modules (other then oauth2) * use a new data sessions oauth2 folder for storing the oauth2 session data * add missing 2FA when this is enabled on the user * add password option for OAuth2 user , for use with git over http and login to the GUI * add tip for registering a GitHub OAuth application * at startup of Gitea register all configured providers and also on adding/deleting of new providers * custom handling of errors in oauth2 request init + show better tip * add ExternalLoginUser model and migration script to add it to database * link a external account to an existing account (still need to handle wrong login and signup) and remove if user is removed * remove the linked external account from the user his settings * if user is unknown we allow him to register a new account or link it to some existing account * sign up with button on signin page (als change OAuth2Provider structure so we can store basic stuff about providers) * from gorilla/sessions docs: "Important Note: If you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler as or else you will leak memory!" (we're using gorilla/sessions for storing oauth2 sessions) * use updated goth lib that now supports getting the OAuth2 user if the AccessToken is still valid instead of re-authenticating (prevent flooding the OAuth2 provider)
8 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. import "fmt"
  6. // ErrNameReserved represents a "reserved name" error.
  7. type ErrNameReserved struct {
  8. Name string
  9. }
  10. // IsErrNameReserved checks if an error is a ErrNameReserved.
  11. func IsErrNameReserved(err error) bool {
  12. _, ok := err.(ErrNameReserved)
  13. return ok
  14. }
  15. func (err ErrNameReserved) Error() string {
  16. return fmt.Sprintf("name is reserved [name: %s]", err.Name)
  17. }
  18. // ErrNamePatternNotAllowed represents a "pattern not allowed" error.
  19. type ErrNamePatternNotAllowed struct {
  20. Pattern string
  21. }
  22. // IsErrNamePatternNotAllowed checks if an error is an
  23. // ErrNamePatternNotAllowed.
  24. func IsErrNamePatternNotAllowed(err error) bool {
  25. _, ok := err.(ErrNamePatternNotAllowed)
  26. return ok
  27. }
  28. func (err ErrNamePatternNotAllowed) Error() string {
  29. return fmt.Sprintf("name pattern is not allowed [pattern: %s]", err.Pattern)
  30. }
  31. // ErrSSHDisabled represents an "SSH disabled" error.
  32. type ErrSSHDisabled struct {
  33. }
  34. // IsErrSSHDisabled checks if an error is a ErrSSHDisabled.
  35. func IsErrSSHDisabled(err error) bool {
  36. _, ok := err.(ErrSSHDisabled)
  37. return ok
  38. }
  39. func (err ErrSSHDisabled) Error() string {
  40. return "SSH is disabled"
  41. }
  42. // ____ ___
  43. // | | \______ ___________
  44. // | | / ___// __ \_ __ \
  45. // | | /\___ \\ ___/| | \/
  46. // |______//____ >\___ >__|
  47. // \/ \/
  48. // ErrUserAlreadyExist represents a "user already exists" error.
  49. type ErrUserAlreadyExist struct {
  50. Name string
  51. }
  52. // IsErrUserAlreadyExist checks if an error is a ErrUserAlreadyExists.
  53. func IsErrUserAlreadyExist(err error) bool {
  54. _, ok := err.(ErrUserAlreadyExist)
  55. return ok
  56. }
  57. func (err ErrUserAlreadyExist) Error() string {
  58. return fmt.Sprintf("user already exists [name: %s]", err.Name)
  59. }
  60. // ErrUserNotExist represents a "UserNotExist" kind of error.
  61. type ErrUserNotExist struct {
  62. UID int64
  63. Name string
  64. KeyID int64
  65. }
  66. // IsErrUserNotExist checks if an error is a ErrUserNotExist.
  67. func IsErrUserNotExist(err error) bool {
  68. _, ok := err.(ErrUserNotExist)
  69. return ok
  70. }
  71. func (err ErrUserNotExist) Error() string {
  72. return fmt.Sprintf("user does not exist [uid: %d, name: %s, keyid: %d]", err.UID, err.Name, err.KeyID)
  73. }
  74. // ErrEmailAlreadyUsed represents a "EmailAlreadyUsed" kind of error.
  75. type ErrEmailAlreadyUsed struct {
  76. Email string
  77. }
  78. // IsErrEmailAlreadyUsed checks if an error is a ErrEmailAlreadyUsed.
  79. func IsErrEmailAlreadyUsed(err error) bool {
  80. _, ok := err.(ErrEmailAlreadyUsed)
  81. return ok
  82. }
  83. func (err ErrEmailAlreadyUsed) Error() string {
  84. return fmt.Sprintf("e-mail has been used [email: %s]", err.Email)
  85. }
  86. // ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error.
  87. type ErrOpenIDAlreadyUsed struct {
  88. OpenID string
  89. }
  90. // IsErrOpenIDAlreadyUsed checks if an error is a ErrOpenIDAlreadyUsed.
  91. func IsErrOpenIDAlreadyUsed(err error) bool {
  92. _, ok := err.(ErrOpenIDAlreadyUsed)
  93. return ok
  94. }
  95. func (err ErrOpenIDAlreadyUsed) Error() string {
  96. return fmt.Sprintf("OpenID has been used [oid: %s]", err.OpenID)
  97. }
  98. // ErrUserOwnRepos represents a "UserOwnRepos" kind of error.
  99. type ErrUserOwnRepos struct {
  100. UID int64
  101. }
  102. // IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.
  103. func IsErrUserOwnRepos(err error) bool {
  104. _, ok := err.(ErrUserOwnRepos)
  105. return ok
  106. }
  107. func (err ErrUserOwnRepos) Error() string {
  108. return fmt.Sprintf("user still has ownership of repositories [uid: %d]", err.UID)
  109. }
  110. // ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
  111. type ErrUserHasOrgs struct {
  112. UID int64
  113. }
  114. // IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.
  115. func IsErrUserHasOrgs(err error) bool {
  116. _, ok := err.(ErrUserHasOrgs)
  117. return ok
  118. }
  119. func (err ErrUserHasOrgs) Error() string {
  120. return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
  121. }
  122. // ErrUserNotAllowedCreateOrg represents a "UserNotAllowedCreateOrg" kind of error.
  123. type ErrUserNotAllowedCreateOrg struct {
  124. }
  125. // IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.
  126. func IsErrUserNotAllowedCreateOrg(err error) bool {
  127. _, ok := err.(ErrUserNotAllowedCreateOrg)
  128. return ok
  129. }
  130. func (err ErrUserNotAllowedCreateOrg) Error() string {
  131. return fmt.Sprintf("user is not allowed to create organizations")
  132. }
  133. // ErrReachLimitOfRepo represents a "ReachLimitOfRepo" kind of error.
  134. type ErrReachLimitOfRepo struct {
  135. Limit int
  136. }
  137. // IsErrReachLimitOfRepo checks if an error is a ErrReachLimitOfRepo.
  138. func IsErrReachLimitOfRepo(err error) bool {
  139. _, ok := err.(ErrReachLimitOfRepo)
  140. return ok
  141. }
  142. func (err ErrReachLimitOfRepo) Error() string {
  143. return fmt.Sprintf("user has reached maximum limit of repositories [limit: %d]", err.Limit)
  144. }
  145. // __ __.__ __ .__
  146. // / \ / \__| | _|__|
  147. // \ \/\/ / | |/ / |
  148. // \ /| | <| |
  149. // \__/\ / |__|__|_ \__|
  150. // \/ \/
  151. // ErrWikiAlreadyExist represents a "WikiAlreadyExist" kind of error.
  152. type ErrWikiAlreadyExist struct {
  153. Title string
  154. }
  155. // IsErrWikiAlreadyExist checks if an error is an ErrWikiAlreadyExist.
  156. func IsErrWikiAlreadyExist(err error) bool {
  157. _, ok := err.(ErrWikiAlreadyExist)
  158. return ok
  159. }
  160. func (err ErrWikiAlreadyExist) Error() string {
  161. return fmt.Sprintf("wiki page already exists [title: %s]", err.Title)
  162. }
  163. // ErrWikiReservedName represents a reserved name error.
  164. type ErrWikiReservedName struct {
  165. Title string
  166. }
  167. // IsErrWikiReservedName checks if an error is an ErrWikiReservedName.
  168. func IsErrWikiReservedName(err error) bool {
  169. _, ok := err.(ErrWikiReservedName)
  170. return ok
  171. }
  172. func (err ErrWikiReservedName) Error() string {
  173. return fmt.Sprintf("wiki title is reserved: %s", err.Title)
  174. }
  175. // __________ ___. .__ .__ ____ __.
  176. // \______ \__ _\_ |__ | | |__| ____ | |/ _|____ ___.__.
  177. // | ___/ | \ __ \| | | |/ ___\ | <_/ __ < | |
  178. // | | | | / \_\ \ |_| \ \___ | | \ ___/\___ |
  179. // |____| |____/|___ /____/__|\___ > |____|__ \___ > ____|
  180. // \/ \/ \/ \/\/
  181. // ErrKeyUnableVerify represents a "KeyUnableVerify" kind of error.
  182. type ErrKeyUnableVerify struct {
  183. Result string
  184. }
  185. // IsErrKeyUnableVerify checks if an error is a ErrKeyUnableVerify.
  186. func IsErrKeyUnableVerify(err error) bool {
  187. _, ok := err.(ErrKeyUnableVerify)
  188. return ok
  189. }
  190. func (err ErrKeyUnableVerify) Error() string {
  191. return fmt.Sprintf("Unable to verify key content [result: %s]", err.Result)
  192. }
  193. // ErrKeyNotExist represents a "KeyNotExist" kind of error.
  194. type ErrKeyNotExist struct {
  195. ID int64
  196. }
  197. // IsErrKeyNotExist checks if an error is a ErrKeyNotExist.
  198. func IsErrKeyNotExist(err error) bool {
  199. _, ok := err.(ErrKeyNotExist)
  200. return ok
  201. }
  202. func (err ErrKeyNotExist) Error() string {
  203. return fmt.Sprintf("public key does not exist [id: %d]", err.ID)
  204. }
  205. // ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error.
  206. type ErrKeyAlreadyExist struct {
  207. OwnerID int64
  208. Fingerprint string
  209. Content string
  210. }
  211. // IsErrKeyAlreadyExist checks if an error is a ErrKeyAlreadyExist.
  212. func IsErrKeyAlreadyExist(err error) bool {
  213. _, ok := err.(ErrKeyAlreadyExist)
  214. return ok
  215. }
  216. func (err ErrKeyAlreadyExist) Error() string {
  217. return fmt.Sprintf("public key already exists [owner_id: %d, finter_print: %s, content: %s]",
  218. err.OwnerID, err.Fingerprint, err.Content)
  219. }
  220. // ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error.
  221. type ErrKeyNameAlreadyUsed struct {
  222. OwnerID int64
  223. Name string
  224. }
  225. // IsErrKeyNameAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  226. func IsErrKeyNameAlreadyUsed(err error) bool {
  227. _, ok := err.(ErrKeyNameAlreadyUsed)
  228. return ok
  229. }
  230. func (err ErrKeyNameAlreadyUsed) Error() string {
  231. return fmt.Sprintf("public key already exists [owner_id: %d, name: %s]", err.OwnerID, err.Name)
  232. }
  233. // ErrGPGNoEmailFound represents a "ErrGPGNoEmailFound" kind of error.
  234. type ErrGPGNoEmailFound struct {
  235. FailedEmails []string
  236. }
  237. // IsErrGPGNoEmailFound checks if an error is a ErrGPGNoEmailFound.
  238. func IsErrGPGNoEmailFound(err error) bool {
  239. _, ok := err.(ErrGPGNoEmailFound)
  240. return ok
  241. }
  242. func (err ErrGPGNoEmailFound) Error() string {
  243. return fmt.Sprintf("none of the emails attached to the GPG key could be found: %v", err.FailedEmails)
  244. }
  245. // ErrGPGKeyParsing represents a "ErrGPGKeyParsing" kind of error.
  246. type ErrGPGKeyParsing struct {
  247. ParseError error
  248. }
  249. // IsErrGPGKeyParsing checks if an error is a ErrGPGKeyParsing.
  250. func IsErrGPGKeyParsing(err error) bool {
  251. _, ok := err.(ErrGPGKeyParsing)
  252. return ok
  253. }
  254. func (err ErrGPGKeyParsing) Error() string {
  255. return fmt.Sprintf("failed to parse gpg key %s", err.ParseError.Error())
  256. }
  257. // ErrGPGKeyNotExist represents a "GPGKeyNotExist" kind of error.
  258. type ErrGPGKeyNotExist struct {
  259. ID int64
  260. }
  261. // IsErrGPGKeyNotExist checks if an error is a ErrGPGKeyNotExist.
  262. func IsErrGPGKeyNotExist(err error) bool {
  263. _, ok := err.(ErrGPGKeyNotExist)
  264. return ok
  265. }
  266. func (err ErrGPGKeyNotExist) Error() string {
  267. return fmt.Sprintf("public gpg key does not exist [id: %d]", err.ID)
  268. }
  269. // ErrGPGKeyIDAlreadyUsed represents a "GPGKeyIDAlreadyUsed" kind of error.
  270. type ErrGPGKeyIDAlreadyUsed struct {
  271. KeyID string
  272. }
  273. // IsErrGPGKeyIDAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  274. func IsErrGPGKeyIDAlreadyUsed(err error) bool {
  275. _, ok := err.(ErrGPGKeyIDAlreadyUsed)
  276. return ok
  277. }
  278. func (err ErrGPGKeyIDAlreadyUsed) Error() string {
  279. return fmt.Sprintf("public key already exists [key_id: %s]", err.KeyID)
  280. }
  281. // ErrGPGKeyAccessDenied represents a "GPGKeyAccessDenied" kind of Error.
  282. type ErrGPGKeyAccessDenied struct {
  283. UserID int64
  284. KeyID int64
  285. }
  286. // IsErrGPGKeyAccessDenied checks if an error is a ErrGPGKeyAccessDenied.
  287. func IsErrGPGKeyAccessDenied(err error) bool {
  288. _, ok := err.(ErrGPGKeyAccessDenied)
  289. return ok
  290. }
  291. // Error pretty-prints an error of type ErrGPGKeyAccessDenied.
  292. func (err ErrGPGKeyAccessDenied) Error() string {
  293. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d]",
  294. err.UserID, err.KeyID)
  295. }
  296. // ErrKeyAccessDenied represents a "KeyAccessDenied" kind of error.
  297. type ErrKeyAccessDenied struct {
  298. UserID int64
  299. KeyID int64
  300. Note string
  301. }
  302. // IsErrKeyAccessDenied checks if an error is a ErrKeyAccessDenied.
  303. func IsErrKeyAccessDenied(err error) bool {
  304. _, ok := err.(ErrKeyAccessDenied)
  305. return ok
  306. }
  307. func (err ErrKeyAccessDenied) Error() string {
  308. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d, note: %s]",
  309. err.UserID, err.KeyID, err.Note)
  310. }
  311. // ErrDeployKeyNotExist represents a "DeployKeyNotExist" kind of error.
  312. type ErrDeployKeyNotExist struct {
  313. ID int64
  314. KeyID int64
  315. RepoID int64
  316. }
  317. // IsErrDeployKeyNotExist checks if an error is a ErrDeployKeyNotExist.
  318. func IsErrDeployKeyNotExist(err error) bool {
  319. _, ok := err.(ErrDeployKeyNotExist)
  320. return ok
  321. }
  322. func (err ErrDeployKeyNotExist) Error() string {
  323. return fmt.Sprintf("Deploy key does not exist [id: %d, key_id: %d, repo_id: %d]", err.ID, err.KeyID, err.RepoID)
  324. }
  325. // ErrDeployKeyAlreadyExist represents a "DeployKeyAlreadyExist" kind of error.
  326. type ErrDeployKeyAlreadyExist struct {
  327. KeyID int64
  328. RepoID int64
  329. }
  330. // IsErrDeployKeyAlreadyExist checks if an error is a ErrDeployKeyAlreadyExist.
  331. func IsErrDeployKeyAlreadyExist(err error) bool {
  332. _, ok := err.(ErrDeployKeyAlreadyExist)
  333. return ok
  334. }
  335. func (err ErrDeployKeyAlreadyExist) Error() string {
  336. return fmt.Sprintf("public key already exists [key_id: %d, repo_id: %d]", err.KeyID, err.RepoID)
  337. }
  338. // ErrDeployKeyNameAlreadyUsed represents a "DeployKeyNameAlreadyUsed" kind of error.
  339. type ErrDeployKeyNameAlreadyUsed struct {
  340. RepoID int64
  341. Name string
  342. }
  343. // IsErrDeployKeyNameAlreadyUsed checks if an error is a ErrDeployKeyNameAlreadyUsed.
  344. func IsErrDeployKeyNameAlreadyUsed(err error) bool {
  345. _, ok := err.(ErrDeployKeyNameAlreadyUsed)
  346. return ok
  347. }
  348. func (err ErrDeployKeyNameAlreadyUsed) Error() string {
  349. return fmt.Sprintf("public key already exists [repo_id: %d, name: %s]", err.RepoID, err.Name)
  350. }
  351. // _____ ___________ __
  352. // / _ \ ____ ____ ____ ______ _____\__ ___/___ | | __ ____ ____
  353. // / /_\ \_/ ___\/ ___\/ __ \ / ___// ___/ | | / _ \| |/ // __ \ / \
  354. // / | \ \__\ \__\ ___/ \___ \ \___ \ | |( <_> ) <\ ___/| | \
  355. // \____|__ /\___ >___ >___ >____ >____ > |____| \____/|__|_ \\___ >___| /
  356. // \/ \/ \/ \/ \/ \/ \/ \/ \/
  357. // ErrAccessTokenNotExist represents a "AccessTokenNotExist" kind of error.
  358. type ErrAccessTokenNotExist struct {
  359. SHA string
  360. }
  361. // IsErrAccessTokenNotExist checks if an error is a ErrAccessTokenNotExist.
  362. func IsErrAccessTokenNotExist(err error) bool {
  363. _, ok := err.(ErrAccessTokenNotExist)
  364. return ok
  365. }
  366. func (err ErrAccessTokenNotExist) Error() string {
  367. return fmt.Sprintf("access token does not exist [sha: %s]", err.SHA)
  368. }
  369. // ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
  370. type ErrAccessTokenEmpty struct {
  371. }
  372. // IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.
  373. func IsErrAccessTokenEmpty(err error) bool {
  374. _, ok := err.(ErrAccessTokenEmpty)
  375. return ok
  376. }
  377. func (err ErrAccessTokenEmpty) Error() string {
  378. return fmt.Sprintf("access token is empty")
  379. }
  380. // ________ .__ __ .__
  381. // \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____
  382. // / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \
  383. // / | \ | \/ /_/ > __ \| | \ |/ / / __ \| | | ( <_> ) | \
  384. // \_______ /__| \___ (____ /___| /__/_____ \(____ /__| |__|\____/|___| /
  385. // \/ /_____/ \/ \/ \/ \/ \/
  386. // ErrOrgNotExist represents a "OrgNotExist" kind of error.
  387. type ErrOrgNotExist struct {
  388. ID int64
  389. Name string
  390. }
  391. // IsErrOrgNotExist checks if an error is a ErrOrgNotExist.
  392. func IsErrOrgNotExist(err error) bool {
  393. _, ok := err.(ErrOrgNotExist)
  394. return ok
  395. }
  396. func (err ErrOrgNotExist) Error() string {
  397. return fmt.Sprintf("org does not exist [id: %d, name: %s]", err.ID, err.Name)
  398. }
  399. // ErrLastOrgOwner represents a "LastOrgOwner" kind of error.
  400. type ErrLastOrgOwner struct {
  401. UID int64
  402. }
  403. // IsErrLastOrgOwner checks if an error is a ErrLastOrgOwner.
  404. func IsErrLastOrgOwner(err error) bool {
  405. _, ok := err.(ErrLastOrgOwner)
  406. return ok
  407. }
  408. func (err ErrLastOrgOwner) Error() string {
  409. return fmt.Sprintf("user is the last member of owner team [uid: %d]", err.UID)
  410. }
  411. //.____ ____________________
  412. //| | \_ _____/ _____/
  413. //| | | __) \_____ \
  414. //| |___| \ / \
  415. //|_______ \___ / /_______ /
  416. // \/ \/ \/
  417. // ErrLFSLockNotExist represents a "LFSLockNotExist" kind of error.
  418. type ErrLFSLockNotExist struct {
  419. ID int64
  420. RepoID int64
  421. Path string
  422. }
  423. // IsErrLFSLockNotExist checks if an error is a ErrLFSLockNotExist.
  424. func IsErrLFSLockNotExist(err error) bool {
  425. _, ok := err.(ErrLFSLockNotExist)
  426. return ok
  427. }
  428. func (err ErrLFSLockNotExist) Error() string {
  429. return fmt.Sprintf("lfs lock does not exist [id: %d, rid: %d, path: %s]", err.ID, err.RepoID, err.Path)
  430. }
  431. // ErrLFSUnauthorizedAction represents a "LFSUnauthorizedAction" kind of error.
  432. type ErrLFSUnauthorizedAction struct {
  433. RepoID int64
  434. UserName string
  435. Mode AccessMode
  436. }
  437. // IsErrLFSUnauthorizedAction checks if an error is a ErrLFSUnauthorizedAction.
  438. func IsErrLFSUnauthorizedAction(err error) bool {
  439. _, ok := err.(ErrLFSUnauthorizedAction)
  440. return ok
  441. }
  442. func (err ErrLFSUnauthorizedAction) Error() string {
  443. if err.Mode == AccessModeWrite {
  444. return fmt.Sprintf("User %s doesn't have write access for lfs lock [rid: %d]", err.UserName, err.RepoID)
  445. }
  446. return fmt.Sprintf("User %s doesn't have read access for lfs lock [rid: %d]", err.UserName, err.RepoID)
  447. }
  448. // ErrLFSLockAlreadyExist represents a "LFSLockAlreadyExist" kind of error.
  449. type ErrLFSLockAlreadyExist struct {
  450. RepoID int64
  451. Path string
  452. }
  453. // IsErrLFSLockAlreadyExist checks if an error is a ErrLFSLockAlreadyExist.
  454. func IsErrLFSLockAlreadyExist(err error) bool {
  455. _, ok := err.(ErrLFSLockAlreadyExist)
  456. return ok
  457. }
  458. func (err ErrLFSLockAlreadyExist) Error() string {
  459. return fmt.Sprintf("lfs lock already exists [rid: %d, path: %s]", err.RepoID, err.Path)
  460. }
  461. // __________ .__ __
  462. // \______ \ ____ ______ ____ _____|__|/ |_ ___________ ___.__.
  463. // | _// __ \\____ \ / _ \/ ___/ \ __\/ _ \_ __ < | |
  464. // | | \ ___/| |_> > <_> )___ \| || | ( <_> ) | \/\___ |
  465. // |____|_ /\___ > __/ \____/____ >__||__| \____/|__| / ____|
  466. // \/ \/|__| \/ \/
  467. // ErrRepoNotExist represents a "RepoNotExist" kind of error.
  468. type ErrRepoNotExist struct {
  469. ID int64
  470. UID int64
  471. OwnerName string
  472. Name string
  473. }
  474. // IsErrRepoNotExist checks if an error is a ErrRepoNotExist.
  475. func IsErrRepoNotExist(err error) bool {
  476. _, ok := err.(ErrRepoNotExist)
  477. return ok
  478. }
  479. func (err ErrRepoNotExist) Error() string {
  480. return fmt.Sprintf("repository does not exist [id: %d, uid: %d, owner_name: %s, name: %s]",
  481. err.ID, err.UID, err.OwnerName, err.Name)
  482. }
  483. // ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.
  484. type ErrRepoAlreadyExist struct {
  485. Uname string
  486. Name string
  487. }
  488. // IsErrRepoAlreadyExist checks if an error is a ErrRepoAlreadyExist.
  489. func IsErrRepoAlreadyExist(err error) bool {
  490. _, ok := err.(ErrRepoAlreadyExist)
  491. return ok
  492. }
  493. func (err ErrRepoAlreadyExist) Error() string {
  494. return fmt.Sprintf("repository already exists [uname: %s, name: %s]", err.Uname, err.Name)
  495. }
  496. // ErrRepoRedirectNotExist represents a "RepoRedirectNotExist" kind of error.
  497. type ErrRepoRedirectNotExist struct {
  498. OwnerID int64
  499. RepoName string
  500. }
  501. // IsErrRepoRedirectNotExist check if an error is an ErrRepoRedirectNotExist
  502. func IsErrRepoRedirectNotExist(err error) bool {
  503. _, ok := err.(ErrRepoRedirectNotExist)
  504. return ok
  505. }
  506. func (err ErrRepoRedirectNotExist) Error() string {
  507. return fmt.Sprintf("repository redirect does not exist [uid: %d, name: %s]", err.OwnerID, err.RepoName)
  508. }
  509. // ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
  510. type ErrInvalidCloneAddr struct {
  511. IsURLError bool
  512. IsInvalidPath bool
  513. IsPermissionDenied bool
  514. }
  515. // IsErrInvalidCloneAddr checks if an error is a ErrInvalidCloneAddr.
  516. func IsErrInvalidCloneAddr(err error) bool {
  517. _, ok := err.(ErrInvalidCloneAddr)
  518. return ok
  519. }
  520. func (err ErrInvalidCloneAddr) Error() string {
  521. return fmt.Sprintf("invalid clone address [is_url_error: %v, is_invalid_path: %v, is_permission_denied: %v]",
  522. err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied)
  523. }
  524. // ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.
  525. type ErrUpdateTaskNotExist struct {
  526. UUID string
  527. }
  528. // IsErrUpdateTaskNotExist checks if an error is a ErrUpdateTaskNotExist.
  529. func IsErrUpdateTaskNotExist(err error) bool {
  530. _, ok := err.(ErrUpdateTaskNotExist)
  531. return ok
  532. }
  533. func (err ErrUpdateTaskNotExist) Error() string {
  534. return fmt.Sprintf("update task does not exist [uuid: %s]", err.UUID)
  535. }
  536. // ErrReleaseAlreadyExist represents a "ReleaseAlreadyExist" kind of error.
  537. type ErrReleaseAlreadyExist struct {
  538. TagName string
  539. }
  540. // IsErrReleaseAlreadyExist checks if an error is a ErrReleaseAlreadyExist.
  541. func IsErrReleaseAlreadyExist(err error) bool {
  542. _, ok := err.(ErrReleaseAlreadyExist)
  543. return ok
  544. }
  545. func (err ErrReleaseAlreadyExist) Error() string {
  546. return fmt.Sprintf("release tag already exist [tag_name: %s]", err.TagName)
  547. }
  548. // ErrReleaseNotExist represents a "ReleaseNotExist" kind of error.
  549. type ErrReleaseNotExist struct {
  550. ID int64
  551. TagName string
  552. }
  553. // IsErrReleaseNotExist checks if an error is a ErrReleaseNotExist.
  554. func IsErrReleaseNotExist(err error) bool {
  555. _, ok := err.(ErrReleaseNotExist)
  556. return ok
  557. }
  558. func (err ErrReleaseNotExist) Error() string {
  559. return fmt.Sprintf("release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName)
  560. }
  561. // ErrInvalidTagName represents a "InvalidTagName" kind of error.
  562. type ErrInvalidTagName struct {
  563. TagName string
  564. }
  565. // IsErrInvalidTagName checks if an error is a ErrInvalidTagName.
  566. func IsErrInvalidTagName(err error) bool {
  567. _, ok := err.(ErrInvalidTagName)
  568. return ok
  569. }
  570. func (err ErrInvalidTagName) Error() string {
  571. return fmt.Sprintf("release tag name is not valid [tag_name: %s]", err.TagName)
  572. }
  573. // ErrRepoFileAlreadyExist represents a "RepoFileAlreadyExist" kind of error.
  574. type ErrRepoFileAlreadyExist struct {
  575. FileName string
  576. }
  577. // IsErrRepoFileAlreadyExist checks if an error is a ErrRepoFileAlreadyExist.
  578. func IsErrRepoFileAlreadyExist(err error) bool {
  579. _, ok := err.(ErrRepoFileAlreadyExist)
  580. return ok
  581. }
  582. func (err ErrRepoFileAlreadyExist) Error() string {
  583. return fmt.Sprintf("repository file already exists [file_name: %s]", err.FileName)
  584. }
  585. // __________ .__
  586. // \______ \____________ ____ ____ | |__
  587. // | | _/\_ __ \__ \ / \_/ ___\| | \
  588. // | | \ | | \// __ \| | \ \___| Y \
  589. // |______ / |__| (____ /___| /\___ >___| /
  590. // \/ \/ \/ \/ \/
  591. // ErrBranchNotExist represents a "BranchNotExist" kind of error.
  592. type ErrBranchNotExist struct {
  593. Name string
  594. }
  595. // IsErrBranchNotExist checks if an error is a ErrBranchNotExist.
  596. func IsErrBranchNotExist(err error) bool {
  597. _, ok := err.(ErrBranchNotExist)
  598. return ok
  599. }
  600. func (err ErrBranchNotExist) Error() string {
  601. return fmt.Sprintf("branch does not exist [name: %s]", err.Name)
  602. }
  603. // ErrBranchAlreadyExists represents an error that branch with such name already exists
  604. type ErrBranchAlreadyExists struct {
  605. BranchName string
  606. }
  607. // IsErrBranchAlreadyExists checks if an error is an ErrBranchAlreadyExists.
  608. func IsErrBranchAlreadyExists(err error) bool {
  609. _, ok := err.(ErrBranchAlreadyExists)
  610. return ok
  611. }
  612. func (err ErrBranchAlreadyExists) Error() string {
  613. return fmt.Sprintf("branch already exists [name: %s]", err.BranchName)
  614. }
  615. // ErrBranchNameConflict represents an error that branch name conflicts with other branch
  616. type ErrBranchNameConflict struct {
  617. BranchName string
  618. }
  619. // IsErrBranchNameConflict checks if an error is an ErrBranchNameConflict.
  620. func IsErrBranchNameConflict(err error) bool {
  621. _, ok := err.(ErrBranchNameConflict)
  622. return ok
  623. }
  624. func (err ErrBranchNameConflict) Error() string {
  625. return fmt.Sprintf("branch conflicts with existing branch [name: %s]", err.BranchName)
  626. }
  627. // ErrTagAlreadyExists represents an error that tag with such name already exists
  628. type ErrTagAlreadyExists struct {
  629. TagName string
  630. }
  631. // IsErrTagAlreadyExists checks if an error is an ErrTagAlreadyExists.
  632. func IsErrTagAlreadyExists(err error) bool {
  633. _, ok := err.(ErrTagAlreadyExists)
  634. return ok
  635. }
  636. func (err ErrTagAlreadyExists) Error() string {
  637. return fmt.Sprintf("tag already exists [name: %s]", err.TagName)
  638. }
  639. // __ __ ___. .__ __
  640. // / \ / \ ____\_ |__ | |__ ____ ____ | | __
  641. // \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ /
  642. // \ /\ ___/| \_\ \ Y ( <_> | <_> ) <
  643. // \__/\ / \___ >___ /___| /\____/ \____/|__|_ \
  644. // \/ \/ \/ \/ \/
  645. // ErrWebhookNotExist represents a "WebhookNotExist" kind of error.
  646. type ErrWebhookNotExist struct {
  647. ID int64
  648. }
  649. // IsErrWebhookNotExist checks if an error is a ErrWebhookNotExist.
  650. func IsErrWebhookNotExist(err error) bool {
  651. _, ok := err.(ErrWebhookNotExist)
  652. return ok
  653. }
  654. func (err ErrWebhookNotExist) Error() string {
  655. return fmt.Sprintf("webhook does not exist [id: %d]", err.ID)
  656. }
  657. // .___
  658. // | | ______ ________ __ ____
  659. // | |/ ___// ___/ | \_/ __ \
  660. // | |\___ \ \___ \| | /\ ___/
  661. // |___/____ >____ >____/ \___ >
  662. // \/ \/ \/
  663. // ErrIssueNotExist represents a "IssueNotExist" kind of error.
  664. type ErrIssueNotExist struct {
  665. ID int64
  666. RepoID int64
  667. Index int64
  668. }
  669. // IsErrIssueNotExist checks if an error is a ErrIssueNotExist.
  670. func IsErrIssueNotExist(err error) bool {
  671. _, ok := err.(ErrIssueNotExist)
  672. return ok
  673. }
  674. func (err ErrIssueNotExist) Error() string {
  675. return fmt.Sprintf("issue does not exist [id: %d, repo_id: %d, index: %d]", err.ID, err.RepoID, err.Index)
  676. }
  677. // __________ .__ .__ __________ __
  678. // \______ \__ __| | | |\______ \ ____ ________ __ ____ _______/ |_
  679. // | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\
  680. // | | | | / |_| |_| | \ ___< <_| | | /\ ___/ \___ \ | |
  681. // |____| |____/|____/____/____|_ /\___ >__ |____/ \___ >____ > |__|
  682. // \/ \/ |__| \/ \/
  683. // ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
  684. type ErrPullRequestNotExist struct {
  685. ID int64
  686. IssueID int64
  687. HeadRepoID int64
  688. BaseRepoID int64
  689. HeadBranch string
  690. BaseBranch string
  691. }
  692. // IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.
  693. func IsErrPullRequestNotExist(err error) bool {
  694. _, ok := err.(ErrPullRequestNotExist)
  695. return ok
  696. }
  697. func (err ErrPullRequestNotExist) Error() string {
  698. return fmt.Sprintf("pull request does not exist [id: %d, issue_id: %d, head_repo_id: %d, base_repo_id: %d, head_branch: %s, base_branch: %s]",
  699. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  700. }
  701. // ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error
  702. type ErrPullRequestAlreadyExists struct {
  703. ID int64
  704. IssueID int64
  705. HeadRepoID int64
  706. BaseRepoID int64
  707. HeadBranch string
  708. BaseBranch string
  709. }
  710. // IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.
  711. func IsErrPullRequestAlreadyExists(err error) bool {
  712. _, ok := err.(ErrPullRequestAlreadyExists)
  713. return ok
  714. }
  715. // Error does pretty-printing :D
  716. func (err ErrPullRequestAlreadyExists) Error() string {
  717. return fmt.Sprintf("pull request already exists for these targets [id: %d, issue_id: %d, head_repo_id: %d, base_repo_id: %d, head_branch: %s, base_branch: %s]",
  718. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  719. }
  720. // ErrInvalidMergeStyle represents an error if merging with disabled merge strategy
  721. type ErrInvalidMergeStyle struct {
  722. ID int64
  723. Style MergeStyle
  724. }
  725. // IsErrInvalidMergeStyle checks if an error is a ErrInvalidMergeStyle.
  726. func IsErrInvalidMergeStyle(err error) bool {
  727. _, ok := err.(ErrInvalidMergeStyle)
  728. return ok
  729. }
  730. func (err ErrInvalidMergeStyle) Error() string {
  731. return fmt.Sprintf("merge strategy is not allowed or is invalid [repo_id: %d, strategy: %s]",
  732. err.ID, err.Style)
  733. }
  734. // _________ __
  735. // \_ ___ \ ____ _____ _____ ____ _____/ |_
  736. // / \ \/ / _ \ / \ / \_/ __ \ / \ __\
  737. // \ \___( <_> ) Y Y \ Y Y \ ___/| | \ |
  738. // \______ /\____/|__|_| /__|_| /\___ >___| /__|
  739. // \/ \/ \/ \/ \/
  740. // ErrCommentNotExist represents a "CommentNotExist" kind of error.
  741. type ErrCommentNotExist struct {
  742. ID int64
  743. IssueID int64
  744. }
  745. // IsErrCommentNotExist checks if an error is a ErrCommentNotExist.
  746. func IsErrCommentNotExist(err error) bool {
  747. _, ok := err.(ErrCommentNotExist)
  748. return ok
  749. }
  750. func (err ErrCommentNotExist) Error() string {
  751. return fmt.Sprintf("comment does not exist [id: %d, issue_id: %d]", err.ID, err.IssueID)
  752. }
  753. // _________ __ __ .__
  754. // / _____// |_ ____ ________ _ _______ _/ |_ ____ | |__
  755. // \_____ \\ __\/ _ \\____ \ \/ \/ /\__ \\ __\/ ___\| | \
  756. // / \| | ( <_> ) |_> > / / __ \| | \ \___| Y \
  757. // /_______ /|__| \____/| __/ \/\_/ (____ /__| \___ >___| /
  758. // \/ |__| \/ \/ \/
  759. // ErrStopwatchNotExist represents a "Stopwatch Not Exist" kind of error.
  760. type ErrStopwatchNotExist struct {
  761. ID int64
  762. }
  763. // IsErrStopwatchNotExist checks if an error is a ErrStopwatchNotExist.
  764. func IsErrStopwatchNotExist(err error) bool {
  765. _, ok := err.(ErrStopwatchNotExist)
  766. return ok
  767. }
  768. func (err ErrStopwatchNotExist) Error() string {
  769. return fmt.Sprintf("stopwatch does not exist [id: %d]", err.ID)
  770. }
  771. // ___________ __ .______________.__
  772. // \__ ___/___________ ____ | | __ ____ __| _/\__ ___/|__| _____ ____
  773. // | | \_ __ \__ \ _/ ___\| |/ // __ \ / __ | | | | |/ \_/ __ \
  774. // | | | | \// __ \\ \___| <\ ___// /_/ | | | | | Y Y \ ___/
  775. // |____| |__| (____ /\___ >__|_ \\___ >____ | |____| |__|__|_| /\___ >
  776. // \/ \/ \/ \/ \/ \/ \/
  777. // ErrTrackedTimeNotExist represents a "TrackedTime Not Exist" kind of error.
  778. type ErrTrackedTimeNotExist struct {
  779. ID int64
  780. }
  781. // IsErrTrackedTimeNotExist checks if an error is a ErrTrackedTimeNotExist.
  782. func IsErrTrackedTimeNotExist(err error) bool {
  783. _, ok := err.(ErrTrackedTimeNotExist)
  784. return ok
  785. }
  786. func (err ErrTrackedTimeNotExist) Error() string {
  787. return fmt.Sprintf("tracked time does not exist [id: %d]", err.ID)
  788. }
  789. // .____ ___. .__
  790. // | | _____ \_ |__ ____ | |
  791. // | | \__ \ | __ \_/ __ \| |
  792. // | |___ / __ \| \_\ \ ___/| |__
  793. // |_______ (____ /___ /\___ >____/
  794. // \/ \/ \/ \/
  795. // ErrLabelNotExist represents a "LabelNotExist" kind of error.
  796. type ErrLabelNotExist struct {
  797. LabelID int64
  798. RepoID int64
  799. }
  800. // IsErrLabelNotExist checks if an error is a ErrLabelNotExist.
  801. func IsErrLabelNotExist(err error) bool {
  802. _, ok := err.(ErrLabelNotExist)
  803. return ok
  804. }
  805. func (err ErrLabelNotExist) Error() string {
  806. return fmt.Sprintf("label does not exist [label_id: %d, repo_id: %d]", err.LabelID, err.RepoID)
  807. }
  808. // _____ .__.__ __
  809. // / \ |__| | ____ _______/ |_ ____ ____ ____
  810. // / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \
  811. // / Y \ | |_\ ___/ \___ \ | | ( <_> ) | \ ___/
  812. // \____|__ /__|____/\___ >____ > |__| \____/|___| /\___ >
  813. // \/ \/ \/ \/ \/
  814. // ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
  815. type ErrMilestoneNotExist struct {
  816. ID int64
  817. RepoID int64
  818. }
  819. // IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
  820. func IsErrMilestoneNotExist(err error) bool {
  821. _, ok := err.(ErrMilestoneNotExist)
  822. return ok
  823. }
  824. func (err ErrMilestoneNotExist) Error() string {
  825. return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
  826. }
  827. // _____ __ __ .__ __
  828. // / _ \_/ |__/ |______ ____ | |__ _____ ____ _____/ |_
  829. // / /_\ \ __\ __\__ \ _/ ___\| | \ / \_/ __ \ / \ __\
  830. // / | \ | | | / __ \\ \___| Y \ Y Y \ ___/| | \ |
  831. // \____|__ /__| |__| (____ /\___ >___| /__|_| /\___ >___| /__|
  832. // \/ \/ \/ \/ \/ \/ \/
  833. // ErrAttachmentNotExist represents a "AttachmentNotExist" kind of error.
  834. type ErrAttachmentNotExist struct {
  835. ID int64
  836. UUID string
  837. }
  838. // IsErrAttachmentNotExist checks if an error is a ErrAttachmentNotExist.
  839. func IsErrAttachmentNotExist(err error) bool {
  840. _, ok := err.(ErrAttachmentNotExist)
  841. return ok
  842. }
  843. func (err ErrAttachmentNotExist) Error() string {
  844. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  845. }
  846. // .____ .__ _________
  847. // | | ____ ____ |__| ____ / _____/ ____ __ _________ ____ ____
  848. // | | / _ \ / ___\| |/ \ \_____ \ / _ \| | \_ __ \_/ ___\/ __ \
  849. // | |__( <_> ) /_/ > | | \ / ( <_> ) | /| | \/\ \__\ ___/
  850. // |_______ \____/\___ /|__|___| / /_______ /\____/|____/ |__| \___ >___ >
  851. // \/ /_____/ \/ \/ \/ \/
  852. // ErrLoginSourceNotExist represents a "LoginSourceNotExist" kind of error.
  853. type ErrLoginSourceNotExist struct {
  854. ID int64
  855. }
  856. // IsErrLoginSourceNotExist checks if an error is a ErrLoginSourceNotExist.
  857. func IsErrLoginSourceNotExist(err error) bool {
  858. _, ok := err.(ErrLoginSourceNotExist)
  859. return ok
  860. }
  861. func (err ErrLoginSourceNotExist) Error() string {
  862. return fmt.Sprintf("login source does not exist [id: %d]", err.ID)
  863. }
  864. // ErrLoginSourceAlreadyExist represents a "LoginSourceAlreadyExist" kind of error.
  865. type ErrLoginSourceAlreadyExist struct {
  866. Name string
  867. }
  868. // IsErrLoginSourceAlreadyExist checks if an error is a ErrLoginSourceAlreadyExist.
  869. func IsErrLoginSourceAlreadyExist(err error) bool {
  870. _, ok := err.(ErrLoginSourceAlreadyExist)
  871. return ok
  872. }
  873. func (err ErrLoginSourceAlreadyExist) Error() string {
  874. return fmt.Sprintf("login source already exists [name: %s]", err.Name)
  875. }
  876. // ErrLoginSourceInUse represents a "LoginSourceInUse" kind of error.
  877. type ErrLoginSourceInUse struct {
  878. ID int64
  879. }
  880. // IsErrLoginSourceInUse checks if an error is a ErrLoginSourceInUse.
  881. func IsErrLoginSourceInUse(err error) bool {
  882. _, ok := err.(ErrLoginSourceInUse)
  883. return ok
  884. }
  885. func (err ErrLoginSourceInUse) Error() string {
  886. return fmt.Sprintf("login source is still used by some users [id: %d]", err.ID)
  887. }
  888. // ___________
  889. // \__ ___/___ _____ _____
  890. // | |_/ __ \\__ \ / \
  891. // | |\ ___/ / __ \| Y Y \
  892. // |____| \___ >____ /__|_| /
  893. // \/ \/ \/
  894. // ErrTeamAlreadyExist represents a "TeamAlreadyExist" kind of error.
  895. type ErrTeamAlreadyExist struct {
  896. OrgID int64
  897. Name string
  898. }
  899. // IsErrTeamAlreadyExist checks if an error is a ErrTeamAlreadyExist.
  900. func IsErrTeamAlreadyExist(err error) bool {
  901. _, ok := err.(ErrTeamAlreadyExist)
  902. return ok
  903. }
  904. func (err ErrTeamAlreadyExist) Error() string {
  905. return fmt.Sprintf("team already exists [org_id: %d, name: %s]", err.OrgID, err.Name)
  906. }
  907. //
  908. // Two-factor authentication
  909. //
  910. // ErrTwoFactorNotEnrolled indicates that a user is not enrolled in two-factor authentication.
  911. type ErrTwoFactorNotEnrolled struct {
  912. UID int64
  913. }
  914. // IsErrTwoFactorNotEnrolled checks if an error is a ErrTwoFactorNotEnrolled.
  915. func IsErrTwoFactorNotEnrolled(err error) bool {
  916. _, ok := err.(ErrTwoFactorNotEnrolled)
  917. return ok
  918. }
  919. func (err ErrTwoFactorNotEnrolled) Error() string {
  920. return fmt.Sprintf("user not enrolled in 2FA [uid: %d]", err.UID)
  921. }
  922. // ____ ___ .__ .___
  923. // | | \______ | | _________ __| _/
  924. // | | /\____ \| | / _ \__ \ / __ |
  925. // | | / | |_> > |_( <_> ) __ \_/ /_/ |
  926. // |______/ | __/|____/\____(____ /\____ |
  927. // |__| \/ \/
  928. //
  929. // ErrUploadNotExist represents a "UploadNotExist" kind of error.
  930. type ErrUploadNotExist struct {
  931. ID int64
  932. UUID string
  933. }
  934. // IsErrUploadNotExist checks if an error is a ErrUploadNotExist.
  935. func IsErrUploadNotExist(err error) bool {
  936. _, ok := err.(ErrAttachmentNotExist)
  937. return ok
  938. }
  939. func (err ErrUploadNotExist) Error() string {
  940. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  941. }
  942. // ___________ __ .__ .____ .__ ____ ___
  943. // \_ _____/__ ____/ |_ ___________ ____ _____ | | | | ____ ____ |__| ____ | | \______ ___________
  944. // | __)_\ \/ /\ __\/ __ \_ __ \/ \\__ \ | | | | / _ \ / ___\| |/ \ | | / ___// __ \_ __ \
  945. // | \> < | | \ ___/| | \/ | \/ __ \| |__ | |__( <_> ) /_/ > | | \ | | /\___ \\ ___/| | \/
  946. // /_______ /__/\_ \ |__| \___ >__| |___| (____ /____/ |_______ \____/\___ /|__|___| / |______//____ >\___ >__|
  947. // \/ \/ \/ \/ \/ \/ /_____/ \/ \/ \/
  948. // ErrExternalLoginUserAlreadyExist represents a "ExternalLoginUserAlreadyExist" kind of error.
  949. type ErrExternalLoginUserAlreadyExist struct {
  950. ExternalID string
  951. UserID int64
  952. LoginSourceID int64
  953. }
  954. // IsErrExternalLoginUserAlreadyExist checks if an error is a ExternalLoginUserAlreadyExist.
  955. func IsErrExternalLoginUserAlreadyExist(err error) bool {
  956. _, ok := err.(ErrExternalLoginUserAlreadyExist)
  957. return ok
  958. }
  959. func (err ErrExternalLoginUserAlreadyExist) Error() string {
  960. return fmt.Sprintf("external login user already exists [externalID: %s, userID: %d, loginSourceID: %d]", err.ExternalID, err.UserID, err.LoginSourceID)
  961. }
  962. // ErrExternalLoginUserNotExist represents a "ExternalLoginUserNotExist" kind of error.
  963. type ErrExternalLoginUserNotExist struct {
  964. UserID int64
  965. LoginSourceID int64
  966. }
  967. // IsErrExternalLoginUserNotExist checks if an error is a ExternalLoginUserNotExist.
  968. func IsErrExternalLoginUserNotExist(err error) bool {
  969. _, ok := err.(ErrExternalLoginUserNotExist)
  970. return ok
  971. }
  972. func (err ErrExternalLoginUserNotExist) Error() string {
  973. return fmt.Sprintf("external login user link does not exists [userID: %d, loginSourceID: %d]", err.UserID, err.LoginSourceID)
  974. }