Jelajahi Sumber

Refactoring: rename modules -> pkg

Reasons to change:

1. Shorter than 'modules'
2. More generally used by other Go projects
3. Corresponds to the naming of '$GOPATH/pkg' directory
Unknwon 7 tahun lalu
induk
melakukan
d05395fe90
100 mengubah file dengan 156 tambahan dan 156 penghapusan
  1. 1 1
      .bra.toml
  2. 9 9
      Makefile
  3. 1 1
      cmd/admin.go
  4. 1 1
      cmd/backup.go
  5. 2 2
      cmd/hook.go
  6. 1 1
      cmd/import.go
  7. 3 3
      cmd/restore.go
  8. 1 1
      cmd/serv.go
  9. 6 6
      cmd/web.go
  10. 1 1
      gogs.go
  11. 2 2
      models/action.go
  12. 2 2
      models/admin.go
  13. 1 1
      models/attachment.go
  14. 1 1
      models/comment.go
  15. 3 3
      models/git_diff.go
  16. 2 2
      models/issue.go
  17. 1 1
      models/issue_label.go
  18. 3 3
      models/issue_mail.go
  19. 2 2
      models/login_source.go
  20. 2 2
      models/migrations/migrations.go
  21. 1 1
      models/migrations/v15.go
  22. 1 1
      models/migrations/v16.go
  23. 1 1
      models/milestone.go
  24. 3 3
      models/mirror.go
  25. 1 1
      models/models.go
  26. 3 3
      models/pull.go
  27. 1 1
      models/release.go
  28. 5 5
      models/repo.go
  29. 1 1
      models/repo_branch.go
  30. 2 2
      models/repo_editor.go
  31. 1 1
      models/repo_test.go
  32. 3 3
      models/ssh_key.go
  33. 1 1
      models/ssh_key_test.go
  34. 1 1
      models/token.go
  35. 3 3
      models/user.go
  36. 3 3
      models/webhook.go
  37. 1 1
      models/webhook_discord.go
  38. 1 1
      models/webhook_slack.go
  39. 2 2
      models/wiki.go
  40. 2 2
      pkg/auth/auth.go
  41. 0 0
      pkg/auth/ldap/README.md
  42. 0 0
      pkg/auth/ldap/ldap.go
  43. 0 0
      pkg/auth/pam/pam.go
  44. 0 0
      pkg/auth/pam/pam_stub.go
  45. 0 0
      pkg/avatar/avatar.go
  46. 0 0
      pkg/avatar/avatar_test.go
  47. 0 0
      pkg/base/base.go
  48. 0 0
      pkg/base/file.go
  49. 1 1
      pkg/base/tool.go
  50. 0 0
      pkg/bindata/bindata.go
  51. 2 2
      pkg/context/api.go
  52. 0 0
      pkg/context/api_org.go
  53. 2 2
      pkg/context/auth.go
  54. 4 4
      pkg/context/context.go
  55. 1 1
      pkg/context/org.go
  56. 1 1
      pkg/context/repo.go
  57. 1 1
      pkg/cron/cron.go
  58. 0 0
      pkg/form/admin.go
  59. 0 0
      pkg/form/auth.go
  60. 0 0
      pkg/form/form.go
  61. 0 0
      pkg/form/org.go
  62. 0 0
      pkg/form/repo.go
  63. 0 0
      pkg/form/user.go
  64. 0 0
      pkg/httplib/httplib.go
  65. 3 3
      pkg/mailer/mail.go
  66. 1 1
      pkg/mailer/mailer.go
  67. 2 2
      pkg/markup/markdown.go
  68. 2 2
      pkg/markup/markdown_test.go
  69. 2 2
      pkg/markup/markup.go
  70. 2 2
      pkg/markup/markup_test.go
  71. 1 1
      pkg/markup/sanitizer.go
  72. 1 1
      pkg/markup/sanitizer_test.go
  73. 0 0
      pkg/process/manager.go
  74. 0 0
      pkg/setting/miniwinsvc.go
  75. 2 2
      pkg/setting/setting.go
  76. 1 1
      pkg/ssh/ssh.go
  77. 0 0
      pkg/sync/exclusive_pool.go
  78. 0 0
      pkg/sync/status_pool.go
  79. 0 0
      pkg/sync/unique_queue.go
  80. 1 1
      pkg/template/highlight/highlight.go
  81. 3 3
      pkg/template/template.go
  82. 0 0
      pkg/user/user.go
  83. 6 6
      routers/admin/admin.go
  84. 5 5
      routers/admin/auths.go
  85. 3 3
      routers/admin/notice.go
  86. 3 3
      routers/admin/orgs.go
  87. 3 3
      routers/admin/repos.go
  88. 5 5
      routers/admin/users.go
  89. 1 1
      routers/api/v1/admin/org.go
  90. 1 1
      routers/api/v1/admin/org_repo.go
  91. 1 1
      routers/api/v1/admin/org_team.go
  92. 1 1
      routers/api/v1/admin/repo.go
  93. 3 3
      routers/api/v1/admin/user.go
  94. 2 2
      routers/api/v1/api.go
  95. 1 1
      routers/api/v1/convert/utils.go
  96. 2 2
      routers/api/v1/misc/markdown.go
  97. 1 1
      routers/api/v1/org/org.go
  98. 1 1
      routers/api/v1/org/team.go
  99. 1 1
      routers/api/v1/repo/branch.go
  100. 1 1
      routers/api/v1/repo/collaborators.go

+ 1 - 1
.bra.toml

@@ -7,7 +7,7 @@ watch_all = true
 watch_dirs = [
 	"$WORKDIR/cmd",
 	"$WORKDIR/models",
-	"$WORKDIR/modules",
+	"$WORKDIR/pkg",
 	"$WORKDIR/routers"
 ]
 watch_exts = [".go"]

+ 9 - 9
Makefile

@@ -1,9 +1,9 @@
-LDFLAGS += -X "github.com/gogits/gogs/modules/setting.BuildTime=$(shell date -u '+%Y-%m-%d %I:%M:%S %Z')"
-LDFLAGS += -X "github.com/gogits/gogs/modules/setting.BuildGitHash=$(shell git rev-parse HEAD)"
+LDFLAGS += -X "github.com/gogits/gogs/pkg/setting.BuildTime=$(shell date -u '+%Y-%m-%d %I:%M:%S %Z')"
+LDFLAGS += -X "github.com/gogits/gogs/pkg/setting.BuildGitHash=$(shell git rev-parse HEAD)"
 
 DATA_FILES := $(shell find conf | sed 's/ /\\ /g')
 LESS_FILES := $(wildcard public/less/gogs.less public/less/_*.less)
-GENERATED  := modules/bindata/bindata.go public/css/gogs.css
+GENERATED  := pkg/bindata/bindata.go public/css/gogs.css
 
 OS := $(shell uname)
 
@@ -27,7 +27,7 @@ dist: release
 
 govet:
 	$(GOVET) gogs.go
-	$(GOVET) models modules routers
+	$(GOVET) models pkg routers
 
 build: $(GENERATED)
 	go install $(BUILD_FLAGS) -ldflags '$(LDFLAGS)' -tags '$(TAGS)'
@@ -50,9 +50,9 @@ pack:
 
 release: build pack
 
-bindata: modules/bindata/bindata.go
+bindata: pkg/bindata/bindata.go
 
-modules/bindata/bindata.go: $(DATA_FILES)
+pkg/bindata/bindata.go: $(DATA_FILES)
 	go-bindata -o=$@ -ignore="\\.DS_Store|README.md|TRANSLATORS" -pkg=bindata conf/...
 
 less: public/css/gogs.css
@@ -70,11 +70,11 @@ test:
 	go test -cover -race ./...
 
 fixme:
-	grep -rnw "FIXME" cmd routers models modules
+	grep -rnw "FIXME" cmd routers models pkg
 
 todo:
-	grep -rnw "TODO" cmd routers models modules
+	grep -rnw "TODO" cmd routers models pkg
 
 # Legacy code should be remove by the time of release
 legacy:
-	grep -rnw "LEGACY" cmd routers models modules
+	grep -rnw "LEGACY" cmd routers models pkg

+ 1 - 1
cmd/admin.go

@@ -10,7 +10,7 @@ import (
 	"github.com/urfave/cli"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 var (

+ 1 - 1
cmd/backup.go

@@ -18,7 +18,7 @@ import (
 	"gopkg.in/ini.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 var Backup = cli.Command{

+ 2 - 2
cmd/hook.go

@@ -21,8 +21,8 @@ import (
 	"github.com/gogits/git-module"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/httplib"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/httplib"
+	"github.com/gogits/gogs/pkg/setting"
 	http "github.com/gogits/gogs/routers/repo"
 )
 

+ 1 - 1
cmd/import.go

@@ -15,7 +15,7 @@ import (
 	"github.com/Unknwon/com"
 	"github.com/urfave/cli"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 var (

+ 3 - 3
cmd/restore.go

@@ -16,7 +16,7 @@ import (
 	"gopkg.in/ini.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 var Restore = cli.Command{
@@ -24,9 +24,9 @@ var Restore = cli.Command{
 	Usage: "Restore files and database from backup",
 	Description: `Restore imports all related files and database from a backup archive.
 The backup version must lower or equal to current Gogs version. You can also import
-backup from other database engines, which is useful for database migrating. 
+backup from other database engines, which is useful for database migrating.
 
-If corresponding files or database tables are not presented in the archive, they will 
+If corresponding files or database tables are not presented in the archive, they will
 be skipped and remian unchanged.`,
 	Action: runRestore,
 	Flags: []cli.Flag{

+ 1 - 1
cmd/serv.go

@@ -18,7 +18,7 @@ import (
 
 	"github.com/gogits/gogs/models"
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 	http "github.com/gogits/gogs/routers/repo"
 )
 

+ 6 - 6
cmd/web.go

@@ -30,12 +30,12 @@ import (
 	"gopkg.in/macaron.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/bindata"
-	"github.com/gogits/gogs/modules/context"
-	"github.com/gogits/gogs/modules/form"
-	"github.com/gogits/gogs/modules/mailer"
-	"github.com/gogits/gogs/modules/setting"
-	"github.com/gogits/gogs/modules/template"
+	"github.com/gogits/gogs/pkg/bindata"
+	"github.com/gogits/gogs/pkg/context"
+	"github.com/gogits/gogs/pkg/form"
+	"github.com/gogits/gogs/pkg/mailer"
+	"github.com/gogits/gogs/pkg/setting"
+	"github.com/gogits/gogs/pkg/template"
 	"github.com/gogits/gogs/routers"
 	"github.com/gogits/gogs/routers/admin"
 	apiv1 "github.com/gogits/gogs/routers/api/v1"

+ 1 - 1
gogs.go

@@ -13,7 +13,7 @@ import (
 	"github.com/urfave/cli"
 
 	"github.com/gogits/gogs/cmd"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 const APP_VER = "0.11.2.0404"

+ 2 - 2
models/action.go

@@ -21,8 +21,8 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 type ActionType int

+ 2 - 2
models/admin.go

@@ -15,8 +15,8 @@ import (
 	"github.com/go-xorm/xorm"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 type NoticeType int

+ 1 - 1
models/attachment.go

@@ -15,7 +15,7 @@ import (
 	"github.com/go-xorm/xorm"
 	gouuid "github.com/satori/go.uuid"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 // Attachment represent a attachment of issue/comment/release.

+ 1 - 1
models/comment.go

@@ -16,7 +16,7 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/markup"
+	"github.com/gogits/gogs/pkg/markup"
 )
 
 // CommentType defines whether a comment is just a simple comment, an action (like close) or a reference.

+ 3 - 3
models/git_diff.go

@@ -17,9 +17,9 @@ import (
 
 	"github.com/gogits/git-module"
 
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/setting"
-	"github.com/gogits/gogs/modules/template/highlight"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/setting"
+	"github.com/gogits/gogs/pkg/template/highlight"
 )
 
 type DiffSection struct {

+ 2 - 2
models/issue.go

@@ -16,8 +16,8 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 var (

+ 1 - 1
models/issue_label.go

@@ -15,7 +15,7 @@ import (
 
 	api "github.com/gogits/go-gogs-client"
 
-	"github.com/gogits/gogs/modules/base"
+	"github.com/gogits/gogs/pkg/base"
 )
 
 var labelColorPattern = regexp.MustCompile("#([a-fA-F0-9]{6})")

+ 3 - 3
models/issue_mail.go

@@ -10,9 +10,9 @@ import (
 	"github.com/Unknwon/com"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/gogs/modules/mailer"
-	"github.com/gogits/gogs/modules/markup"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/mailer"
+	"github.com/gogits/gogs/pkg/markup"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 func (issue *Issue) MailSubject() string {

+ 2 - 2
models/login_source.go

@@ -20,8 +20,8 @@ import (
 	log "gopkg.in/clog.v1"
 
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/auth/ldap"
-	"github.com/gogits/gogs/modules/auth/pam"
+	"github.com/gogits/gogs/pkg/auth/ldap"
+	"github.com/gogits/gogs/pkg/auth/pam"
 )
 
 type LoginType int

+ 2 - 2
models/migrations/migrations.go

@@ -13,7 +13,7 @@ import (
 	"github.com/go-xorm/xorm"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/gogs/modules/base"
+	"github.com/gogits/gogs/pkg/base"
 )
 
 const _MIN_DB_VER = 10
@@ -105,7 +105,7 @@ Please save following instructions to somewhere and start working:
 Once finished downloading,
 
 1. Extract the archive and to upgrade steps as usual.
-2. Run it once. To verify, you should see some migration traces. 
+2. Run it once. To verify, you should see some migration traces.
 3. Once it starts web server successfully, stop it.
 4. Now it's time to put back the release archive you originally intent to upgrade.
 5. Enjoy!

+ 1 - 1
models/migrations/v15.go

@@ -15,7 +15,7 @@ import (
 	"github.com/go-xorm/xorm"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 func generateAndMigrateGitHooks(x *xorm.Engine) (err error) {

+ 1 - 1
models/migrations/v16.go

@@ -14,7 +14,7 @@ import (
 
 	"github.com/gogits/git-module"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 func updateRepositorySizes(x *xorm.Engine) (err error) {

+ 1 - 1
models/milestone.go

@@ -13,7 +13,7 @@ import (
 
 	api "github.com/gogits/go-gogs-client"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 // Milestone represents a milestone of repository.

+ 3 - 3
models/mirror.go

@@ -17,9 +17,9 @@ import (
 	"github.com/gogits/git-module"
 
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/process"
-	"github.com/gogits/gogs/modules/setting"
-	"github.com/gogits/gogs/modules/sync"
+	"github.com/gogits/gogs/pkg/process"
+	"github.com/gogits/gogs/pkg/setting"
+	"github.com/gogits/gogs/pkg/sync"
 )
 
 var MirrorQueue = sync.NewUniqueQueue(setting.Repository.MirrorQueueLength)

+ 1 - 1
models/models.go

@@ -24,7 +24,7 @@ import (
 	log "gopkg.in/clog.v1"
 
 	"github.com/gogits/gogs/models/migrations"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 // Engine represents a xorm engine or session.

+ 3 - 3
models/pull.go

@@ -19,9 +19,9 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/process"
-	"github.com/gogits/gogs/modules/setting"
-	"github.com/gogits/gogs/modules/sync"
+	"github.com/gogits/gogs/pkg/process"
+	"github.com/gogits/gogs/pkg/setting"
+	"github.com/gogits/gogs/pkg/sync"
 )
 
 var PullRequestQueue = sync.NewUniqueQueue(setting.Repository.PullRequestQueueLength)

+ 1 - 1
models/release.go

@@ -17,7 +17,7 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/process"
+	"github.com/gogits/gogs/pkg/process"
 )
 
 // Release represents a release of repository.

+ 5 - 5
models/repo.go

@@ -27,11 +27,11 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/bindata"
-	"github.com/gogits/gogs/modules/markup"
-	"github.com/gogits/gogs/modules/process"
-	"github.com/gogits/gogs/modules/setting"
-	"github.com/gogits/gogs/modules/sync"
+	"github.com/gogits/gogs/pkg/bindata"
+	"github.com/gogits/gogs/pkg/markup"
+	"github.com/gogits/gogs/pkg/process"
+	"github.com/gogits/gogs/pkg/setting"
+	"github.com/gogits/gogs/pkg/sync"
 )
 
 var repoWorkingPool = sync.NewExclusivePool()

+ 1 - 1
models/repo_branch.go

@@ -11,7 +11,7 @@ import (
 	"github.com/Unknwon/com"
 	"github.com/gogits/git-module"
 
-	"github.com/gogits/gogs/modules/base"
+	"github.com/gogits/gogs/pkg/base"
 )
 
 type Branch struct {

+ 2 - 2
models/repo_editor.go

@@ -21,8 +21,8 @@ import (
 
 	git "github.com/gogits/git-module"
 
-	"github.com/gogits/gogs/modules/process"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/process"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 // ___________    .___.__  __    ___________.__.__

+ 1 - 1
models/repo_test.go

@@ -6,7 +6,7 @@ import (
 	. "github.com/smartystreets/goconvey/convey"
 
 	. "github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/markup"
+	"github.com/gogits/gogs/pkg/markup"
 )
 
 func TestRepo(t *testing.T) {

+ 3 - 3
models/ssh_key.go

@@ -23,9 +23,9 @@ import (
 	"golang.org/x/crypto/ssh"
 	log "gopkg.in/clog.v1"
 
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/process"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/process"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 const (

+ 1 - 1
models/ssh_key_test.go

@@ -11,7 +11,7 @@ import (
 
 	. "github.com/smartystreets/goconvey/convey"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 func init() {

+ 1 - 1
models/token.go

@@ -10,7 +10,7 @@ import (
 	"github.com/go-xorm/xorm"
 	gouuid "github.com/satori/go.uuid"
 
-	"github.com/gogits/gogs/modules/base"
+	"github.com/gogits/gogs/pkg/base"
 )
 
 // AccessToken represents a personal access token.

+ 3 - 3
models/user.go

@@ -30,9 +30,9 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/avatar"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/avatar"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 type UserType int

+ 3 - 3
models/webhook.go

@@ -22,9 +22,9 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/httplib"
-	"github.com/gogits/gogs/modules/setting"
-	"github.com/gogits/gogs/modules/sync"
+	"github.com/gogits/gogs/pkg/httplib"
+	"github.com/gogits/gogs/pkg/setting"
+	"github.com/gogits/gogs/pkg/sync"
 )
 
 var HookQueue = sync.NewUniqueQueue(setting.Webhook.QueueLength)

+ 1 - 1
models/webhook_discord.go

@@ -13,7 +13,7 @@ import (
 	"github.com/gogits/git-module"
 	api "github.com/gogits/go-gogs-client"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 type DiscordEmbedFooterObject struct {

+ 1 - 1
models/webhook_slack.go

@@ -12,7 +12,7 @@ import (
 	"github.com/gogits/git-module"
 	api "github.com/gogits/go-gogs-client"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 type SlackMeta struct {

+ 2 - 2
models/wiki.go

@@ -17,8 +17,8 @@ import (
 
 	"github.com/gogits/git-module"
 
-	"github.com/gogits/gogs/modules/setting"
-	"github.com/gogits/gogs/modules/sync"
+	"github.com/gogits/gogs/pkg/setting"
+	"github.com/gogits/gogs/pkg/sync"
 )
 
 var wikiWorkingPool = sync.NewExclusivePool()

+ 2 - 2
modules/auth/auth.go → pkg/auth/auth.go

@@ -15,8 +15,8 @@ import (
 
 	"github.com/gogits/gogs/models"
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 func IsAPIPath(url string) bool {

+ 0 - 0
modules/auth/ldap/README.md → pkg/auth/ldap/README.md


+ 0 - 0
modules/auth/ldap/ldap.go → pkg/auth/ldap/ldap.go


+ 0 - 0
modules/auth/pam/pam.go → pkg/auth/pam/pam.go


+ 0 - 0
modules/auth/pam/pam_stub.go → pkg/auth/pam/pam_stub.go


+ 0 - 0
modules/avatar/avatar.go → pkg/avatar/avatar.go


+ 0 - 0
modules/avatar/avatar_test.go → pkg/avatar/avatar_test.go


+ 0 - 0
modules/base/base.go → pkg/base/base.go


+ 0 - 0
modules/base/file.go → pkg/base/file.go


+ 1 - 1
modules/base/tool.go → pkg/base/tool.go

@@ -24,7 +24,7 @@ import (
 
 	"github.com/gogits/chardet"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 // EncodeMD5 encodes string to md5 hex value.

+ 0 - 0
modules/bindata/bindata.go → pkg/bindata/bindata.go


+ 2 - 2
modules/context/api.go → pkg/context/api.go

@@ -12,8 +12,8 @@ import (
 	log "gopkg.in/clog.v1"
 	"gopkg.in/macaron.v1"
 
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 type APIContext struct {

+ 0 - 0
modules/context/api_org.go → pkg/context/api_org.go


+ 2 - 2
modules/context/auth.go → pkg/context/auth.go

@@ -10,8 +10,8 @@ import (
 	"github.com/go-macaron/csrf"
 	"gopkg.in/macaron.v1"
 
-	"github.com/gogits/gogs/modules/auth"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/auth"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 type ToggleOptions struct {

+ 4 - 4
modules/context/context.go → pkg/context/context.go

@@ -20,10 +20,10 @@ import (
 	"gopkg.in/macaron.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/auth"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/form"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/auth"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/form"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 // Context represents context of a request.

+ 1 - 1
modules/context/org.go → pkg/context/org.go

@@ -11,7 +11,7 @@ import (
 
 	"github.com/gogits/gogs/models"
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 type Organization struct {

+ 1 - 1
modules/context/repo.go → pkg/context/repo.go

@@ -18,7 +18,7 @@ import (
 
 	"github.com/gogits/gogs/models"
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 type PullRequest struct {

+ 1 - 1
modules/cron/cron.go → pkg/cron/cron.go

@@ -12,7 +12,7 @@ import (
 	"github.com/gogits/cron"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 var c = cron.New()

+ 0 - 0
modules/form/admin.go → pkg/form/admin.go


+ 0 - 0
modules/form/auth.go → pkg/form/auth.go


+ 0 - 0
modules/form/form.go → pkg/form/form.go


+ 0 - 0
modules/form/org.go → pkg/form/org.go


+ 0 - 0
modules/form/repo.go → pkg/form/repo.go


+ 0 - 0
modules/form/user.go → pkg/form/user.go


+ 0 - 0
modules/httplib/httplib.go → pkg/httplib/httplib.go


+ 3 - 3
modules/mailer/mail.go → pkg/mailer/mail.go

@@ -12,9 +12,9 @@ import (
 	"gopkg.in/gomail.v2"
 	"gopkg.in/macaron.v1"
 
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/markup"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/markup"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 const (

+ 1 - 1
modules/mailer/mailer.go → pkg/mailer/mailer.go

@@ -18,7 +18,7 @@ import (
 	log "gopkg.in/clog.v1"
 	"gopkg.in/gomail.v2"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 type Message struct {

+ 2 - 2
modules/markup/markdown.go → pkg/markup/markdown.go

@@ -14,8 +14,8 @@ import (
 
 	"github.com/russross/blackfriday"
 
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 // IsMarkdownFile reports whether name looks like a Markdown file based on its extension.

+ 2 - 2
modules/markup/markdown_test.go → pkg/markup/markdown_test.go

@@ -12,8 +12,8 @@ import (
 	"github.com/russross/blackfriday"
 	. "github.com/smartystreets/goconvey/convey"
 
-	. "github.com/gogits/gogs/modules/markup"
-	"github.com/gogits/gogs/modules/setting"
+	. "github.com/gogits/gogs/pkg/markup"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 func Test_IsMarkdownFile(t *testing.T) {

+ 2 - 2
modules/markup/markup.go → pkg/markup/markup.go

@@ -14,8 +14,8 @@ import (
 	"github.com/Unknwon/com"
 	"golang.org/x/net/html"
 
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 // IsReadmeFile reports whether name looks like a README file based on its extension.

+ 2 - 2
modules/markup/markup_test.go → pkg/markup/markup_test.go

@@ -10,8 +10,8 @@ import (
 
 	. "github.com/smartystreets/goconvey/convey"
 
-	. "github.com/gogits/gogs/modules/markup"
-	"github.com/gogits/gogs/modules/setting"
+	. "github.com/gogits/gogs/pkg/markup"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 func Test_IsReadmeFile(t *testing.T) {

+ 1 - 1
modules/markup/sanitizer.go → pkg/markup/sanitizer.go

@@ -10,7 +10,7 @@ import (
 
 	"github.com/microcosm-cc/bluemonday"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 // Sanitizer is a protection wrapper of *bluemonday.Policy which does not allow

+ 1 - 1
modules/markup/sanitizer_test.go → pkg/markup/sanitizer_test.go

@@ -9,7 +9,7 @@ import (
 
 	. "github.com/smartystreets/goconvey/convey"
 
-	. "github.com/gogits/gogs/modules/markup"
+	. "github.com/gogits/gogs/pkg/markup"
 )
 
 func Test_Sanitizer(t *testing.T) {

+ 0 - 0
modules/process/manager.go → pkg/process/manager.go


+ 0 - 0
modules/setting/miniwinsvc.go → pkg/setting/miniwinsvc.go


+ 2 - 2
modules/setting/setting.go → pkg/setting/setting.go

@@ -26,8 +26,8 @@ import (
 
 	"github.com/gogits/go-libravatar"
 
-	"github.com/gogits/gogs/modules/bindata"
-	"github.com/gogits/gogs/modules/user"
+	"github.com/gogits/gogs/pkg/bindata"
+	"github.com/gogits/gogs/pkg/user"
 )
 
 type Scheme string

+ 1 - 1
modules/ssh/ssh.go → pkg/ssh/ssh.go

@@ -19,7 +19,7 @@ import (
 	log "gopkg.in/clog.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 func cleanCommand(cmd string) string {

+ 0 - 0
modules/sync/exclusive_pool.go → pkg/sync/exclusive_pool.go


+ 0 - 0
modules/sync/status_pool.go → pkg/sync/status_pool.go


+ 0 - 0
modules/sync/unique_queue.go → pkg/sync/unique_queue.go


+ 1 - 1
modules/template/highlight/highlight.go → pkg/template/highlight/highlight.go

@@ -8,7 +8,7 @@ import (
 	"path"
 	"strings"
 
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 var (

+ 3 - 3
modules/template/template.go → pkg/template/template.go

@@ -22,9 +22,9 @@ import (
 	"gopkg.in/editorconfig/editorconfig-core-go.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/markup"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/markup"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 func NewFuncMap() []template.FuncMap {

+ 0 - 0
modules/user/user.go → pkg/user/user.go


+ 6 - 6
routers/admin/admin.go

@@ -15,12 +15,12 @@ import (
 	"gopkg.in/macaron.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/context"
-	"github.com/gogits/gogs/modules/cron"
-	"github.com/gogits/gogs/modules/mailer"
-	"github.com/gogits/gogs/modules/process"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/context"
+	"github.com/gogits/gogs/pkg/cron"
+	"github.com/gogits/gogs/pkg/mailer"
+	"github.com/gogits/gogs/pkg/process"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 const (

+ 5 - 5
routers/admin/auths.go

@@ -12,11 +12,11 @@ import (
 	log "gopkg.in/clog.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/auth/ldap"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/context"
-	"github.com/gogits/gogs/modules/form"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/auth/ldap"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/context"
+	"github.com/gogits/gogs/pkg/form"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 const (

+ 3 - 3
routers/admin/notice.go

@@ -10,9 +10,9 @@ import (
 	log "gopkg.in/clog.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/context"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/context"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 const (

+ 3 - 3
routers/admin/orgs.go

@@ -6,9 +6,9 @@ package admin
 
 import (
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/context"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/context"
+	"github.com/gogits/gogs/pkg/setting"
 	"github.com/gogits/gogs/routers"
 )
 

+ 3 - 3
routers/admin/repos.go

@@ -9,9 +9,9 @@ import (
 	log "gopkg.in/clog.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/context"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/context"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 const (

+ 5 - 5
routers/admin/users.go

@@ -11,11 +11,11 @@ import (
 	log "gopkg.in/clog.v1"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/base"
-	"github.com/gogits/gogs/modules/context"
-	"github.com/gogits/gogs/modules/form"
-	"github.com/gogits/gogs/modules/mailer"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/base"
+	"github.com/gogits/gogs/pkg/context"
+	"github.com/gogits/gogs/pkg/form"
+	"github.com/gogits/gogs/pkg/mailer"
+	"github.com/gogits/gogs/pkg/setting"
 	"github.com/gogits/gogs/routers"
 )
 

+ 1 - 1
routers/api/v1/admin/org.go

@@ -8,7 +8,7 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/context"
+	"github.com/gogits/gogs/pkg/context"
 	"github.com/gogits/gogs/routers/api/v1/convert"
 	"github.com/gogits/gogs/routers/api/v1/user"
 )

+ 1 - 1
routers/api/v1/admin/org_repo.go

@@ -7,7 +7,7 @@ package admin
 import (
 	"github.com/gogits/gogs/models"
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/context"
+	"github.com/gogits/gogs/pkg/context"
 )
 
 func GetRepositoryByParams(ctx *context.APIContext) *models.Repository {

+ 1 - 1
routers/api/v1/admin/org_team.go

@@ -8,7 +8,7 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/context"
+	"github.com/gogits/gogs/pkg/context"
 	"github.com/gogits/gogs/routers/api/v1/convert"
 	"github.com/gogits/gogs/routers/api/v1/user"
 )

+ 1 - 1
routers/api/v1/admin/repo.go

@@ -7,7 +7,7 @@ package admin
 import (
 	api "github.com/gogits/go-gogs-client"
 
-	"github.com/gogits/gogs/modules/context"
+	"github.com/gogits/gogs/pkg/context"
 	"github.com/gogits/gogs/routers/api/v1/repo"
 	"github.com/gogits/gogs/routers/api/v1/user"
 )

+ 3 - 3
routers/api/v1/admin/user.go

@@ -10,9 +10,9 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/context"
-	"github.com/gogits/gogs/modules/mailer"
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/context"
+	"github.com/gogits/gogs/pkg/mailer"
+	"github.com/gogits/gogs/pkg/setting"
 	"github.com/gogits/gogs/routers/api/v1/user"
 )
 

+ 2 - 2
routers/api/v1/api.go

@@ -14,8 +14,8 @@ import (
 
 	"github.com/gogits/gogs/models"
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/context"
-	"github.com/gogits/gogs/modules/form"
+	"github.com/gogits/gogs/pkg/context"
+	"github.com/gogits/gogs/pkg/form"
 	"github.com/gogits/gogs/routers/api/v1/admin"
 	"github.com/gogits/gogs/routers/api/v1/misc"
 	"github.com/gogits/gogs/routers/api/v1/org"

+ 1 - 1
routers/api/v1/convert/utils.go

@@ -5,7 +5,7 @@
 package convert
 
 import (
-	"github.com/gogits/gogs/modules/setting"
+	"github.com/gogits/gogs/pkg/setting"
 )
 
 // ToCorrectPageSize makes sure page size is in allowed range.

+ 2 - 2
routers/api/v1/misc/markdown.go

@@ -7,8 +7,8 @@ package misc
 import (
 	api "github.com/gogits/go-gogs-client"
 
-	"github.com/gogits/gogs/modules/context"
-	"github.com/gogits/gogs/modules/markup"
+	"github.com/gogits/gogs/pkg/context"
+	"github.com/gogits/gogs/pkg/markup"
 )
 
 // https://github.com/gogits/go-gogs-client/wiki/Miscellaneous#render-an-arbitrary-markdown-document

+ 1 - 1
routers/api/v1/org/org.go

@@ -8,7 +8,7 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/context"
+	"github.com/gogits/gogs/pkg/context"
 	"github.com/gogits/gogs/routers/api/v1/convert"
 	"github.com/gogits/gogs/routers/api/v1/user"
 )

+ 1 - 1
routers/api/v1/org/team.go

@@ -7,7 +7,7 @@ package org
 import (
 	api "github.com/gogits/go-gogs-client"
 
-	"github.com/gogits/gogs/modules/context"
+	"github.com/gogits/gogs/pkg/context"
 	"github.com/gogits/gogs/routers/api/v1/convert"
 )
 

+ 1 - 1
routers/api/v1/repo/branch.go

@@ -8,7 +8,7 @@ import (
 	api "github.com/gogits/go-gogs-client"
 
 	"github.com/gogits/gogs/models"
-	"github.com/gogits/gogs/modules/context"
+	"github.com/gogits/gogs/pkg/context"
 	"github.com/gogits/gogs/routers/api/v1/convert"
 )
 

+ 1 - 1
routers/api/v1/repo/collaborators.go

@@ -9,7 +9,7 @@ import (
 
 	"github.com/gogits/gogs/models"
 	"github.com/gogits/gogs/models/errors"
-	"github.com/gogits/gogs/modules/context"
+	"github.com/gogits/gogs/pkg/context"
 )
 
 func ListCollaborators(ctx *context.APIContext) {

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini