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

982 lines
30 KiB

9 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
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
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
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)
7 years ago
  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 (
  6. "fmt"
  7. )
  8. // ErrNameReserved represents a "reserved name" error.
  9. type ErrNameReserved struct {
  10. Name string
  11. }
  12. // IsErrNameReserved checks if an error is a ErrNameReserved.
  13. func IsErrNameReserved(err error) bool {
  14. _, ok := err.(ErrNameReserved)
  15. return ok
  16. }
  17. func (err ErrNameReserved) Error() string {
  18. return fmt.Sprintf("name is reserved [name: %s]", err.Name)
  19. }
  20. // ErrNamePatternNotAllowed represents a "pattern not allowed" error.
  21. type ErrNamePatternNotAllowed struct {
  22. Pattern string
  23. }
  24. // IsErrNamePatternNotAllowed checks if an error is an
  25. // ErrNamePatternNotAllowed.
  26. func IsErrNamePatternNotAllowed(err error) bool {
  27. _, ok := err.(ErrNamePatternNotAllowed)
  28. return ok
  29. }
  30. func (err ErrNamePatternNotAllowed) Error() string {
  31. return fmt.Sprintf("name pattern is not allowed [pattern: %s]", err.Pattern)
  32. }
  33. // ____ ___
  34. // | | \______ ___________
  35. // | | / ___// __ \_ __ \
  36. // | | /\___ \\ ___/| | \/
  37. // |______//____ >\___ >__|
  38. // \/ \/
  39. // ErrUserAlreadyExist represents a "user already exists" error.
  40. type ErrUserAlreadyExist struct {
  41. Name string
  42. }
  43. // IsErrUserAlreadyExist checks if an error is a ErrUserAlreadyExists.
  44. func IsErrUserAlreadyExist(err error) bool {
  45. _, ok := err.(ErrUserAlreadyExist)
  46. return ok
  47. }
  48. func (err ErrUserAlreadyExist) Error() string {
  49. return fmt.Sprintf("user already exists [name: %s]", err.Name)
  50. }
  51. // ErrUserNotExist represents a "UserNotExist" kind of error.
  52. type ErrUserNotExist struct {
  53. UID int64
  54. Name string
  55. KeyID int64
  56. }
  57. // IsErrUserNotExist checks if an error is a ErrUserNotExist.
  58. func IsErrUserNotExist(err error) bool {
  59. _, ok := err.(ErrUserNotExist)
  60. return ok
  61. }
  62. func (err ErrUserNotExist) Error() string {
  63. return fmt.Sprintf("user does not exist [uid: %d, name: %s, keyid: %d]", err.UID, err.Name, err.KeyID)
  64. }
  65. // ErrEmailAlreadyUsed represents a "EmailAlreadyUsed" kind of error.
  66. type ErrEmailAlreadyUsed struct {
  67. Email string
  68. }
  69. // IsErrEmailAlreadyUsed checks if an error is a ErrEmailAlreadyUsed.
  70. func IsErrEmailAlreadyUsed(err error) bool {
  71. _, ok := err.(ErrEmailAlreadyUsed)
  72. return ok
  73. }
  74. func (err ErrEmailAlreadyUsed) Error() string {
  75. return fmt.Sprintf("e-mail has been used [email: %s]", err.Email)
  76. }
  77. // ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error.
  78. type ErrOpenIDAlreadyUsed struct {
  79. OpenID string
  80. }
  81. // IsErrOpenIDAlreadyUsed checks if an error is a ErrOpenIDAlreadyUsed.
  82. func IsErrOpenIDAlreadyUsed(err error) bool {
  83. _, ok := err.(ErrOpenIDAlreadyUsed)
  84. return ok
  85. }
  86. func (err ErrOpenIDAlreadyUsed) Error() string {
  87. return fmt.Sprintf("OpenID has been used [oid: %s]", err.OpenID)
  88. }
  89. // ErrUserOwnRepos represents a "UserOwnRepos" kind of error.
  90. type ErrUserOwnRepos struct {
  91. UID int64
  92. }
  93. // IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.
  94. func IsErrUserOwnRepos(err error) bool {
  95. _, ok := err.(ErrUserOwnRepos)
  96. return ok
  97. }
  98. func (err ErrUserOwnRepos) Error() string {
  99. return fmt.Sprintf("user still has ownership of repositories [uid: %d]", err.UID)
  100. }
  101. // ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
  102. type ErrUserHasOrgs struct {
  103. UID int64
  104. }
  105. // IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.
  106. func IsErrUserHasOrgs(err error) bool {
  107. _, ok := err.(ErrUserHasOrgs)
  108. return ok
  109. }
  110. func (err ErrUserHasOrgs) Error() string {
  111. return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
  112. }
  113. // ErrUserNotAllowedCreateOrg represents a "UserNotAllowedCreateOrg" kind of error.
  114. type ErrUserNotAllowedCreateOrg struct {
  115. }
  116. // IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.
  117. func IsErrUserNotAllowedCreateOrg(err error) bool {
  118. _, ok := err.(ErrUserNotAllowedCreateOrg)
  119. return ok
  120. }
  121. func (err ErrUserNotAllowedCreateOrg) Error() string {
  122. return fmt.Sprintf("user is not allowed to create organizations")
  123. }
  124. // ErrReachLimitOfRepo represents a "ReachLimitOfRepo" kind of error.
  125. type ErrReachLimitOfRepo struct {
  126. Limit int
  127. }
  128. // IsErrReachLimitOfRepo checks if an error is a ErrReachLimitOfRepo.
  129. func IsErrReachLimitOfRepo(err error) bool {
  130. _, ok := err.(ErrReachLimitOfRepo)
  131. return ok
  132. }
  133. func (err ErrReachLimitOfRepo) Error() string {
  134. return fmt.Sprintf("user has reached maximum limit of repositories [limit: %d]", err.Limit)
  135. }
  136. // __ __.__ __ .__
  137. // / \ / \__| | _|__|
  138. // \ \/\/ / | |/ / |
  139. // \ /| | <| |
  140. // \__/\ / |__|__|_ \__|
  141. // \/ \/
  142. // ErrWikiAlreadyExist represents a "WikiAlreadyExist" kind of error.
  143. type ErrWikiAlreadyExist struct {
  144. Title string
  145. }
  146. // IsErrWikiAlreadyExist checks if an error is a ErrWikiAlreadyExist.
  147. func IsErrWikiAlreadyExist(err error) bool {
  148. _, ok := err.(ErrWikiAlreadyExist)
  149. return ok
  150. }
  151. func (err ErrWikiAlreadyExist) Error() string {
  152. return fmt.Sprintf("wiki page already exists [title: %s]", err.Title)
  153. }
  154. // __________ ___. .__ .__ ____ __.
  155. // \______ \__ _\_ |__ | | |__| ____ | |/ _|____ ___.__.
  156. // | ___/ | \ __ \| | | |/ ___\ | <_/ __ < | |
  157. // | | | | / \_\ \ |_| \ \___ | | \ ___/\___ |
  158. // |____| |____/|___ /____/__|\___ > |____|__ \___ > ____|
  159. // \/ \/ \/ \/\/
  160. // ErrKeyUnableVerify represents a "KeyUnableVerify" kind of error.
  161. type ErrKeyUnableVerify struct {
  162. Result string
  163. }
  164. // IsErrKeyUnableVerify checks if an error is a ErrKeyUnableVerify.
  165. func IsErrKeyUnableVerify(err error) bool {
  166. _, ok := err.(ErrKeyUnableVerify)
  167. return ok
  168. }
  169. func (err ErrKeyUnableVerify) Error() string {
  170. return fmt.Sprintf("Unable to verify key content [result: %s]", err.Result)
  171. }
  172. // ErrKeyNotExist represents a "KeyNotExist" kind of error.
  173. type ErrKeyNotExist struct {
  174. ID int64
  175. }
  176. // IsErrKeyNotExist checks if an error is a ErrKeyNotExist.
  177. func IsErrKeyNotExist(err error) bool {
  178. _, ok := err.(ErrKeyNotExist)
  179. return ok
  180. }
  181. func (err ErrKeyNotExist) Error() string {
  182. return fmt.Sprintf("public key does not exist [id: %d]", err.ID)
  183. }
  184. // ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error.
  185. type ErrKeyAlreadyExist struct {
  186. OwnerID int64
  187. Fingerprint string
  188. Content string
  189. }
  190. // IsErrKeyAlreadyExist checks if an error is a ErrKeyAlreadyExist.
  191. func IsErrKeyAlreadyExist(err error) bool {
  192. _, ok := err.(ErrKeyAlreadyExist)
  193. return ok
  194. }
  195. func (err ErrKeyAlreadyExist) Error() string {
  196. return fmt.Sprintf("public key already exists [owner_id: %d, finter_print: %s, content: %s]",
  197. err.OwnerID, err.Fingerprint, err.Content)
  198. }
  199. // ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error.
  200. type ErrKeyNameAlreadyUsed struct {
  201. OwnerID int64
  202. Name string
  203. }
  204. // IsErrKeyNameAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  205. func IsErrKeyNameAlreadyUsed(err error) bool {
  206. _, ok := err.(ErrKeyNameAlreadyUsed)
  207. return ok
  208. }
  209. func (err ErrKeyNameAlreadyUsed) Error() string {
  210. return fmt.Sprintf("public key already exists [owner_id: %d, name: %s]", err.OwnerID, err.Name)
  211. }
  212. // ErrGPGEmailNotFound represents a "ErrGPGEmailNotFound" kind of error.
  213. type ErrGPGEmailNotFound struct {
  214. Email string
  215. }
  216. // IsErrGPGEmailNotFound checks if an error is a ErrGPGEmailNotFound.
  217. func IsErrGPGEmailNotFound(err error) bool {
  218. _, ok := err.(ErrGPGEmailNotFound)
  219. return ok
  220. }
  221. func (err ErrGPGEmailNotFound) Error() string {
  222. return fmt.Sprintf("failed to found email or is not confirmed : %s", err.Email)
  223. }
  224. // ErrGPGKeyParsing represents a "ErrGPGKeyParsing" kind of error.
  225. type ErrGPGKeyParsing struct {
  226. ParseError error
  227. }
  228. // IsErrGPGKeyParsing checks if an error is a ErrGPGKeyParsing.
  229. func IsErrGPGKeyParsing(err error) bool {
  230. _, ok := err.(ErrGPGKeyParsing)
  231. return ok
  232. }
  233. func (err ErrGPGKeyParsing) Error() string {
  234. return fmt.Sprintf("failed to parse gpg key %s", err.ParseError.Error())
  235. }
  236. // ErrGPGKeyNotExist represents a "GPGKeyNotExist" kind of error.
  237. type ErrGPGKeyNotExist struct {
  238. ID int64
  239. }
  240. // IsErrGPGKeyNotExist checks if an error is a ErrGPGKeyNotExist.
  241. func IsErrGPGKeyNotExist(err error) bool {
  242. _, ok := err.(ErrGPGKeyNotExist)
  243. return ok
  244. }
  245. func (err ErrGPGKeyNotExist) Error() string {
  246. return fmt.Sprintf("public gpg key does not exist [id: %d]", err.ID)
  247. }
  248. // ErrGPGKeyIDAlreadyUsed represents a "GPGKeyIDAlreadyUsed" kind of error.
  249. type ErrGPGKeyIDAlreadyUsed struct {
  250. KeyID string
  251. }
  252. // IsErrGPGKeyIDAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  253. func IsErrGPGKeyIDAlreadyUsed(err error) bool {
  254. _, ok := err.(ErrGPGKeyIDAlreadyUsed)
  255. return ok
  256. }
  257. func (err ErrGPGKeyIDAlreadyUsed) Error() string {
  258. return fmt.Sprintf("public key already exists [key_id: %s]", err.KeyID)
  259. }
  260. // ErrGPGKeyAccessDenied represents a "GPGKeyAccessDenied" kind of Error.
  261. type ErrGPGKeyAccessDenied struct {
  262. UserID int64
  263. KeyID int64
  264. }
  265. // IsErrGPGKeyAccessDenied checks if an error is a ErrGPGKeyAccessDenied.
  266. func IsErrGPGKeyAccessDenied(err error) bool {
  267. _, ok := err.(ErrGPGKeyAccessDenied)
  268. return ok
  269. }
  270. // Error pretty-prints an error of type ErrGPGKeyAccessDenied.
  271. func (err ErrGPGKeyAccessDenied) Error() string {
  272. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d]",
  273. err.UserID, err.KeyID)
  274. }
  275. // ErrKeyAccessDenied represents a "KeyAccessDenied" kind of error.
  276. type ErrKeyAccessDenied struct {
  277. UserID int64
  278. KeyID int64
  279. Note string
  280. }
  281. // IsErrKeyAccessDenied checks if an error is a ErrKeyAccessDenied.
  282. func IsErrKeyAccessDenied(err error) bool {
  283. _, ok := err.(ErrKeyAccessDenied)
  284. return ok
  285. }
  286. func (err ErrKeyAccessDenied) Error() string {
  287. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d, note: %s]",
  288. err.UserID, err.KeyID, err.Note)
  289. }
  290. // ErrDeployKeyNotExist represents a "DeployKeyNotExist" kind of error.
  291. type ErrDeployKeyNotExist struct {
  292. ID int64
  293. KeyID int64
  294. RepoID int64
  295. }
  296. // IsErrDeployKeyNotExist checks if an error is a ErrDeployKeyNotExist.
  297. func IsErrDeployKeyNotExist(err error) bool {
  298. _, ok := err.(ErrDeployKeyNotExist)
  299. return ok
  300. }
  301. func (err ErrDeployKeyNotExist) Error() string {
  302. return fmt.Sprintf("Deploy key does not exist [id: %d, key_id: %d, repo_id: %d]", err.ID, err.KeyID, err.RepoID)
  303. }
  304. // ErrDeployKeyAlreadyExist represents a "DeployKeyAlreadyExist" kind of error.
  305. type ErrDeployKeyAlreadyExist struct {
  306. KeyID int64
  307. RepoID int64
  308. }
  309. // IsErrDeployKeyAlreadyExist checks if an error is a ErrDeployKeyAlreadyExist.
  310. func IsErrDeployKeyAlreadyExist(err error) bool {
  311. _, ok := err.(ErrDeployKeyAlreadyExist)
  312. return ok
  313. }
  314. func (err ErrDeployKeyAlreadyExist) Error() string {
  315. return fmt.Sprintf("public key already exists [key_id: %d, repo_id: %d]", err.KeyID, err.RepoID)
  316. }
  317. // ErrDeployKeyNameAlreadyUsed represents a "DeployKeyNameAlreadyUsed" kind of error.
  318. type ErrDeployKeyNameAlreadyUsed struct {
  319. RepoID int64
  320. Name string
  321. }
  322. // IsErrDeployKeyNameAlreadyUsed checks if an error is a ErrDeployKeyNameAlreadyUsed.
  323. func IsErrDeployKeyNameAlreadyUsed(err error) bool {
  324. _, ok := err.(ErrDeployKeyNameAlreadyUsed)
  325. return ok
  326. }
  327. func (err ErrDeployKeyNameAlreadyUsed) Error() string {
  328. return fmt.Sprintf("public key already exists [repo_id: %d, name: %s]", err.RepoID, err.Name)
  329. }
  330. // _____ ___________ __
  331. // / _ \ ____ ____ ____ ______ _____\__ ___/___ | | __ ____ ____
  332. // / /_\ \_/ ___\/ ___\/ __ \ / ___// ___/ | | / _ \| |/ // __ \ / \
  333. // / | \ \__\ \__\ ___/ \___ \ \___ \ | |( <_> ) <\ ___/| | \
  334. // \____|__ /\___ >___ >___ >____ >____ > |____| \____/|__|_ \\___ >___| /
  335. // \/ \/ \/ \/ \/ \/ \/ \/ \/
  336. // ErrAccessTokenNotExist represents a "AccessTokenNotExist" kind of error.
  337. type ErrAccessTokenNotExist struct {
  338. SHA string
  339. }
  340. // IsErrAccessTokenNotExist checks if an error is a ErrAccessTokenNotExist.
  341. func IsErrAccessTokenNotExist(err error) bool {
  342. _, ok := err.(ErrAccessTokenNotExist)
  343. return ok
  344. }
  345. func (err ErrAccessTokenNotExist) Error() string {
  346. return fmt.Sprintf("access token does not exist [sha: %s]", err.SHA)
  347. }
  348. // ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
  349. type ErrAccessTokenEmpty struct {
  350. }
  351. // IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.
  352. func IsErrAccessTokenEmpty(err error) bool {
  353. _, ok := err.(ErrAccessTokenEmpty)
  354. return ok
  355. }
  356. func (err ErrAccessTokenEmpty) Error() string {
  357. return fmt.Sprintf("access token is empty")
  358. }
  359. // ________ .__ __ .__
  360. // \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____
  361. // / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \
  362. // / | \ | \/ /_/ > __ \| | \ |/ / / __ \| | | ( <_> ) | \
  363. // \_______ /__| \___ (____ /___| /__/_____ \(____ /__| |__|\____/|___| /
  364. // \/ /_____/ \/ \/ \/ \/ \/
  365. // ErrLastOrgOwner represents a "LastOrgOwner" kind of error.
  366. type ErrLastOrgOwner struct {
  367. UID int64
  368. }
  369. // IsErrLastOrgOwner checks if an error is a ErrLastOrgOwner.
  370. func IsErrLastOrgOwner(err error) bool {
  371. _, ok := err.(ErrLastOrgOwner)
  372. return ok
  373. }
  374. func (err ErrLastOrgOwner) Error() string {
  375. return fmt.Sprintf("user is the last member of owner team [uid: %d]", err.UID)
  376. }
  377. // __________ .__ __
  378. // \______ \ ____ ______ ____ _____|__|/ |_ ___________ ___.__.
  379. // | _// __ \\____ \ / _ \/ ___/ \ __\/ _ \_ __ < | |
  380. // | | \ ___/| |_> > <_> )___ \| || | ( <_> ) | \/\___ |
  381. // |____|_ /\___ > __/ \____/____ >__||__| \____/|__| / ____|
  382. // \/ \/|__| \/ \/
  383. // ErrRepoNotExist represents a "RepoNotExist" kind of error.
  384. type ErrRepoNotExist struct {
  385. ID int64
  386. UID int64
  387. Name string
  388. }
  389. // IsErrRepoNotExist checks if an error is a ErrRepoNotExist.
  390. func IsErrRepoNotExist(err error) bool {
  391. _, ok := err.(ErrRepoNotExist)
  392. return ok
  393. }
  394. func (err ErrRepoNotExist) Error() string {
  395. return fmt.Sprintf("repository does not exist [id: %d, uid: %d, name: %s]", err.ID, err.UID, err.Name)
  396. }
  397. // ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.
  398. type ErrRepoAlreadyExist struct {
  399. Uname string
  400. Name string
  401. }
  402. // IsErrRepoAlreadyExist checks if an error is a ErrRepoAlreadyExist.
  403. func IsErrRepoAlreadyExist(err error) bool {
  404. _, ok := err.(ErrRepoAlreadyExist)
  405. return ok
  406. }
  407. func (err ErrRepoAlreadyExist) Error() string {
  408. return fmt.Sprintf("repository already exists [uname: %s, name: %s]", err.Uname, err.Name)
  409. }
  410. // ErrRepoRedirectNotExist represents a "RepoRedirectNotExist" kind of error.
  411. type ErrRepoRedirectNotExist struct {
  412. OwnerID int64
  413. RepoName string
  414. }
  415. // IsErrRepoRedirectNotExist check if an error is an ErrRepoRedirectNotExist
  416. func IsErrRepoRedirectNotExist(err error) bool {
  417. _, ok := err.(ErrRepoRedirectNotExist)
  418. return ok
  419. }
  420. func (err ErrRepoRedirectNotExist) Error() string {
  421. return fmt.Sprintf("repository redirect does not exist [uid: %d, name: %s]", err.OwnerID, err.RepoName)
  422. }
  423. // ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
  424. type ErrInvalidCloneAddr struct {
  425. IsURLError bool
  426. IsInvalidPath bool
  427. IsPermissionDenied bool
  428. }
  429. // IsErrInvalidCloneAddr checks if an error is a ErrInvalidCloneAddr.
  430. func IsErrInvalidCloneAddr(err error) bool {
  431. _, ok := err.(ErrInvalidCloneAddr)
  432. return ok
  433. }
  434. func (err ErrInvalidCloneAddr) Error() string {
  435. return fmt.Sprintf("invalid clone address [is_url_error: %v, is_invalid_path: %v, is_permission_denied: %v]",
  436. err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied)
  437. }
  438. // ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.
  439. type ErrUpdateTaskNotExist struct {
  440. UUID string
  441. }
  442. // IsErrUpdateTaskNotExist checks if an error is a ErrUpdateTaskNotExist.
  443. func IsErrUpdateTaskNotExist(err error) bool {
  444. _, ok := err.(ErrUpdateTaskNotExist)
  445. return ok
  446. }
  447. func (err ErrUpdateTaskNotExist) Error() string {
  448. return fmt.Sprintf("update task does not exist [uuid: %s]", err.UUID)
  449. }
  450. // ErrReleaseAlreadyExist represents a "ReleaseAlreadyExist" kind of error.
  451. type ErrReleaseAlreadyExist struct {
  452. TagName string
  453. }
  454. // IsErrReleaseAlreadyExist checks if an error is a ErrReleaseAlreadyExist.
  455. func IsErrReleaseAlreadyExist(err error) bool {
  456. _, ok := err.(ErrReleaseAlreadyExist)
  457. return ok
  458. }
  459. func (err ErrReleaseAlreadyExist) Error() string {
  460. return fmt.Sprintf("release tag already exist [tag_name: %s]", err.TagName)
  461. }
  462. // ErrReleaseNotExist represents a "ReleaseNotExist" kind of error.
  463. type ErrReleaseNotExist struct {
  464. ID int64
  465. TagName string
  466. }
  467. // IsErrReleaseNotExist checks if an error is a ErrReleaseNotExist.
  468. func IsErrReleaseNotExist(err error) bool {
  469. _, ok := err.(ErrReleaseNotExist)
  470. return ok
  471. }
  472. func (err ErrReleaseNotExist) Error() string {
  473. return fmt.Sprintf("release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName)
  474. }
  475. // ErrInvalidTagName represents a "InvalidTagName" kind of error.
  476. type ErrInvalidTagName struct {
  477. TagName string
  478. }
  479. // IsErrInvalidTagName checks if an error is a ErrInvalidTagName.
  480. func IsErrInvalidTagName(err error) bool {
  481. _, ok := err.(ErrInvalidTagName)
  482. return ok
  483. }
  484. func (err ErrInvalidTagName) Error() string {
  485. return fmt.Sprintf("release tag name is not valid [tag_name: %s]", err.TagName)
  486. }
  487. // ErrRepoFileAlreadyExist represents a "RepoFileAlreadyExist" kind of error.
  488. type ErrRepoFileAlreadyExist struct {
  489. FileName string
  490. }
  491. // IsErrRepoFileAlreadyExist checks if an error is a ErrRepoFileAlreadyExist.
  492. func IsErrRepoFileAlreadyExist(err error) bool {
  493. _, ok := err.(ErrRepoFileAlreadyExist)
  494. return ok
  495. }
  496. func (err ErrRepoFileAlreadyExist) Error() string {
  497. return fmt.Sprintf("repository file already exists [file_name: %s]", err.FileName)
  498. }
  499. // __________ .__
  500. // \______ \____________ ____ ____ | |__
  501. // | | _/\_ __ \__ \ / \_/ ___\| | \
  502. // | | \ | | \// __ \| | \ \___| Y \
  503. // |______ / |__| (____ /___| /\___ >___| /
  504. // \/ \/ \/ \/ \/
  505. // ErrBranchNotExist represents a "BranchNotExist" kind of error.
  506. type ErrBranchNotExist struct {
  507. Name string
  508. }
  509. // IsErrBranchNotExist checks if an error is a ErrBranchNotExist.
  510. func IsErrBranchNotExist(err error) bool {
  511. _, ok := err.(ErrBranchNotExist)
  512. return ok
  513. }
  514. func (err ErrBranchNotExist) Error() string {
  515. return fmt.Sprintf("branch does not exist [name: %s]", err.Name)
  516. }
  517. // __ __ ___. .__ __
  518. // / \ / \ ____\_ |__ | |__ ____ ____ | | __
  519. // \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ /
  520. // \ /\ ___/| \_\ \ Y ( <_> | <_> ) <
  521. // \__/\ / \___ >___ /___| /\____/ \____/|__|_ \
  522. // \/ \/ \/ \/ \/
  523. // ErrWebhookNotExist represents a "WebhookNotExist" kind of error.
  524. type ErrWebhookNotExist struct {
  525. ID int64
  526. }
  527. // IsErrWebhookNotExist checks if an error is a ErrWebhookNotExist.
  528. func IsErrWebhookNotExist(err error) bool {
  529. _, ok := err.(ErrWebhookNotExist)
  530. return ok
  531. }
  532. func (err ErrWebhookNotExist) Error() string {
  533. return fmt.Sprintf("webhook does not exist [id: %d]", err.ID)
  534. }
  535. // .___
  536. // | | ______ ________ __ ____
  537. // | |/ ___// ___/ | \_/ __ \
  538. // | |\___ \ \___ \| | /\ ___/
  539. // |___/____ >____ >____/ \___ >
  540. // \/ \/ \/
  541. // ErrIssueNotExist represents a "IssueNotExist" kind of error.
  542. type ErrIssueNotExist struct {
  543. ID int64
  544. RepoID int64
  545. Index int64
  546. }
  547. // IsErrIssueNotExist checks if an error is a ErrIssueNotExist.
  548. func IsErrIssueNotExist(err error) bool {
  549. _, ok := err.(ErrIssueNotExist)
  550. return ok
  551. }
  552. func (err ErrIssueNotExist) Error() string {
  553. return fmt.Sprintf("issue does not exist [id: %d, repo_id: %d, index: %d]", err.ID, err.RepoID, err.Index)
  554. }
  555. // __________ .__ .__ __________ __
  556. // \______ \__ __| | | |\______ \ ____ ________ __ ____ _______/ |_
  557. // | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\
  558. // | | | | / |_| |_| | \ ___< <_| | | /\ ___/ \___ \ | |
  559. // |____| |____/|____/____/____|_ /\___ >__ |____/ \___ >____ > |__|
  560. // \/ \/ |__| \/ \/
  561. // ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
  562. type ErrPullRequestNotExist struct {
  563. ID int64
  564. IssueID int64
  565. HeadRepoID int64
  566. BaseRepoID int64
  567. HeadBranch string
  568. BaseBranch string
  569. }
  570. // IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.
  571. func IsErrPullRequestNotExist(err error) bool {
  572. _, ok := err.(ErrPullRequestNotExist)
  573. return ok
  574. }
  575. func (err ErrPullRequestNotExist) Error() string {
  576. 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]",
  577. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  578. }
  579. // ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error
  580. type ErrPullRequestAlreadyExists struct {
  581. ID int64
  582. IssueID int64
  583. HeadRepoID int64
  584. BaseRepoID int64
  585. HeadBranch string
  586. BaseBranch string
  587. }
  588. // IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.
  589. func IsErrPullRequestAlreadyExists(err error) bool {
  590. _, ok := err.(ErrPullRequestAlreadyExists)
  591. return ok
  592. }
  593. // Error does pretty-printing :D
  594. func (err ErrPullRequestAlreadyExists) Error() string {
  595. 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]",
  596. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  597. }
  598. // _________ __
  599. // \_ ___ \ ____ _____ _____ ____ _____/ |_
  600. // / \ \/ / _ \ / \ / \_/ __ \ / \ __\
  601. // \ \___( <_> ) Y Y \ Y Y \ ___/| | \ |
  602. // \______ /\____/|__|_| /__|_| /\___ >___| /__|
  603. // \/ \/ \/ \/ \/
  604. // ErrCommentNotExist represents a "CommentNotExist" kind of error.
  605. type ErrCommentNotExist struct {
  606. ID int64
  607. IssueID int64
  608. }
  609. // IsErrCommentNotExist checks if an error is a ErrCommentNotExist.
  610. func IsErrCommentNotExist(err error) bool {
  611. _, ok := err.(ErrCommentNotExist)
  612. return ok
  613. }
  614. func (err ErrCommentNotExist) Error() string {
  615. return fmt.Sprintf("comment does not exist [id: %d, issue_id: %d]", err.ID, err.IssueID)
  616. }
  617. // .____ ___. .__
  618. // | | _____ \_ |__ ____ | |
  619. // | | \__ \ | __ \_/ __ \| |
  620. // | |___ / __ \| \_\ \ ___/| |__
  621. // |_______ (____ /___ /\___ >____/
  622. // \/ \/ \/ \/
  623. // ErrLabelNotExist represents a "LabelNotExist" kind of error.
  624. type ErrLabelNotExist struct {
  625. LabelID int64
  626. RepoID int64
  627. }
  628. // IsErrLabelNotExist checks if an error is a ErrLabelNotExist.
  629. func IsErrLabelNotExist(err error) bool {
  630. _, ok := err.(ErrLabelNotExist)
  631. return ok
  632. }
  633. func (err ErrLabelNotExist) Error() string {
  634. return fmt.Sprintf("label does not exist [label_id: %d, repo_id: %d]", err.LabelID, err.RepoID)
  635. }
  636. // _____ .__.__ __
  637. // / \ |__| | ____ _______/ |_ ____ ____ ____
  638. // / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \
  639. // / Y \ | |_\ ___/ \___ \ | | ( <_> ) | \ ___/
  640. // \____|__ /__|____/\___ >____ > |__| \____/|___| /\___ >
  641. // \/ \/ \/ \/ \/
  642. // ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
  643. type ErrMilestoneNotExist struct {
  644. ID int64
  645. RepoID int64
  646. }
  647. // IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
  648. func IsErrMilestoneNotExist(err error) bool {
  649. _, ok := err.(ErrMilestoneNotExist)
  650. return ok
  651. }
  652. func (err ErrMilestoneNotExist) Error() string {
  653. return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
  654. }
  655. // _____ __ __ .__ __
  656. // / _ \_/ |__/ |______ ____ | |__ _____ ____ _____/ |_
  657. // / /_\ \ __\ __\__ \ _/ ___\| | \ / \_/ __ \ / \ __\
  658. // / | \ | | | / __ \\ \___| Y \ Y Y \ ___/| | \ |
  659. // \____|__ /__| |__| (____ /\___ >___| /__|_| /\___ >___| /__|
  660. // \/ \/ \/ \/ \/ \/ \/
  661. // ErrAttachmentNotExist represents a "AttachmentNotExist" kind of error.
  662. type ErrAttachmentNotExist struct {
  663. ID int64
  664. UUID string
  665. }
  666. // IsErrAttachmentNotExist checks if an error is a ErrAttachmentNotExist.
  667. func IsErrAttachmentNotExist(err error) bool {
  668. _, ok := err.(ErrAttachmentNotExist)
  669. return ok
  670. }
  671. func (err ErrAttachmentNotExist) Error() string {
  672. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  673. }
  674. // .____ .__ _________
  675. // | | ____ ____ |__| ____ / _____/ ____ __ _________ ____ ____
  676. // | | / _ \ / ___\| |/ \ \_____ \ / _ \| | \_ __ \_/ ___\/ __ \
  677. // | |__( <_> ) /_/ > | | \ / ( <_> ) | /| | \/\ \__\ ___/
  678. // |_______ \____/\___ /|__|___| / /_______ /\____/|____/ |__| \___ >___ >
  679. // \/ /_____/ \/ \/ \/ \/
  680. // ErrLoginSourceNotExist represents a "LoginSourceNotExist" kind of error.
  681. type ErrLoginSourceNotExist struct {
  682. ID int64
  683. }
  684. // IsErrLoginSourceNotExist checks if an error is a ErrLoginSourceNotExist.
  685. func IsErrLoginSourceNotExist(err error) bool {
  686. _, ok := err.(ErrLoginSourceNotExist)
  687. return ok
  688. }
  689. func (err ErrLoginSourceNotExist) Error() string {
  690. return fmt.Sprintf("login source does not exist [id: %d]", err.ID)
  691. }
  692. // ErrLoginSourceAlreadyExist represents a "LoginSourceAlreadyExist" kind of error.
  693. type ErrLoginSourceAlreadyExist struct {
  694. Name string
  695. }
  696. // IsErrLoginSourceAlreadyExist checks if an error is a ErrLoginSourceAlreadyExist.
  697. func IsErrLoginSourceAlreadyExist(err error) bool {
  698. _, ok := err.(ErrLoginSourceAlreadyExist)
  699. return ok
  700. }
  701. func (err ErrLoginSourceAlreadyExist) Error() string {
  702. return fmt.Sprintf("login source already exists [name: %s]", err.Name)
  703. }
  704. // ErrLoginSourceInUse represents a "LoginSourceInUse" kind of error.
  705. type ErrLoginSourceInUse struct {
  706. ID int64
  707. }
  708. // IsErrLoginSourceInUse checks if an error is a ErrLoginSourceInUse.
  709. func IsErrLoginSourceInUse(err error) bool {
  710. _, ok := err.(ErrLoginSourceInUse)
  711. return ok
  712. }
  713. func (err ErrLoginSourceInUse) Error() string {
  714. return fmt.Sprintf("login source is still used by some users [id: %d]", err.ID)
  715. }
  716. // ___________
  717. // \__ ___/___ _____ _____
  718. // | |_/ __ \\__ \ / \
  719. // | |\ ___/ / __ \| Y Y \
  720. // |____| \___ >____ /__|_| /
  721. // \/ \/ \/
  722. // ErrTeamAlreadyExist represents a "TeamAlreadyExist" kind of error.
  723. type ErrTeamAlreadyExist struct {
  724. OrgID int64
  725. Name string
  726. }
  727. // IsErrTeamAlreadyExist checks if an error is a ErrTeamAlreadyExist.
  728. func IsErrTeamAlreadyExist(err error) bool {
  729. _, ok := err.(ErrTeamAlreadyExist)
  730. return ok
  731. }
  732. func (err ErrTeamAlreadyExist) Error() string {
  733. return fmt.Sprintf("team already exists [org_id: %d, name: %s]", err.OrgID, err.Name)
  734. }
  735. //
  736. // Two-factor authentication
  737. //
  738. // ErrTwoFactorNotEnrolled indicates that a user is not enrolled in two-factor authentication.
  739. type ErrTwoFactorNotEnrolled struct {
  740. UID int64
  741. }
  742. // IsErrTwoFactorNotEnrolled checks if an error is a ErrTwoFactorNotEnrolled.
  743. func IsErrTwoFactorNotEnrolled(err error) bool {
  744. _, ok := err.(ErrTwoFactorNotEnrolled)
  745. return ok
  746. }
  747. func (err ErrTwoFactorNotEnrolled) Error() string {
  748. return fmt.Sprintf("user not enrolled in 2FA [uid: %d]", err.UID)
  749. }
  750. // ____ ___ .__ .___
  751. // | | \______ | | _________ __| _/
  752. // | | /\____ \| | / _ \__ \ / __ |
  753. // | | / | |_> > |_( <_> ) __ \_/ /_/ |
  754. // |______/ | __/|____/\____(____ /\____ |
  755. // |__| \/ \/
  756. //
  757. // ErrUploadNotExist represents a "UploadNotExist" kind of error.
  758. type ErrUploadNotExist struct {
  759. ID int64
  760. UUID string
  761. }
  762. // IsErrUploadNotExist checks if an error is a ErrUploadNotExist.
  763. func IsErrUploadNotExist(err error) bool {
  764. _, ok := err.(ErrAttachmentNotExist)
  765. return ok
  766. }
  767. func (err ErrUploadNotExist) Error() string {
  768. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  769. }
  770. // ___________ __ .__ .____ .__ ____ ___
  771. // \_ _____/__ ____/ |_ ___________ ____ _____ | | | | ____ ____ |__| ____ | | \______ ___________
  772. // | __)_\ \/ /\ __\/ __ \_ __ \/ \\__ \ | | | | / _ \ / ___\| |/ \ | | / ___// __ \_ __ \
  773. // | \> < | | \ ___/| | \/ | \/ __ \| |__ | |__( <_> ) /_/ > | | \ | | /\___ \\ ___/| | \/
  774. // /_______ /__/\_ \ |__| \___ >__| |___| (____ /____/ |_______ \____/\___ /|__|___| / |______//____ >\___ >__|
  775. // \/ \/ \/ \/ \/ \/ /_____/ \/ \/ \/
  776. // ErrExternalLoginUserAlreadyExist represents a "ExternalLoginUserAlreadyExist" kind of error.
  777. type ErrExternalLoginUserAlreadyExist struct {
  778. ExternalID string
  779. UserID int64
  780. LoginSourceID int64
  781. }
  782. // IsErrExternalLoginUserAlreadyExist checks if an error is a ExternalLoginUserAlreadyExist.
  783. func IsErrExternalLoginUserAlreadyExist(err error) bool {
  784. _, ok := err.(ErrExternalLoginUserAlreadyExist)
  785. return ok
  786. }
  787. func (err ErrExternalLoginUserAlreadyExist) Error() string {
  788. return fmt.Sprintf("external login user already exists [externalID: %s, userID: %d, loginSourceID: %d]", err.ExternalID, err.UserID, err.LoginSourceID)
  789. }
  790. // ErrExternalLoginUserNotExist represents a "ExternalLoginUserNotExist" kind of error.
  791. type ErrExternalLoginUserNotExist struct {
  792. UserID int64
  793. LoginSourceID int64
  794. }
  795. // IsErrExternalLoginUserNotExist checks if an error is a ExternalLoginUserNotExist.
  796. func IsErrExternalLoginUserNotExist(err error) bool {
  797. _, ok := err.(ErrExternalLoginUserNotExist)
  798. return ok
  799. }
  800. func (err ErrExternalLoginUserNotExist) Error() string {
  801. return fmt.Sprintf("external login user link does not exists [userID: %d, loginSourceID: %d]", err.UserID, err.LoginSourceID)
  802. }