diff --git a/.bra.toml b/.bra.toml index 3fd4e0c68..83205fc6e 100644 --- a/.bra.toml +++ b/.bra.toml @@ -7,7 +7,7 @@ watch_all = true watch_dirs = [ "$WORKDIR/cmd", "$WORKDIR/models", - "$WORKDIR/modules", + "$WORKDIR/pkg", "$WORKDIR/routers" ] watch_exts = [".go"] diff --git a/Makefile b/Makefile index a71776ffa..507632dd1 100644 --- a/Makefile +++ b/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 diff --git a/cmd/admin.go b/cmd/admin.go index 58e82f5fe..02b192d5d 100644 --- a/cmd/admin.go +++ b/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 ( diff --git a/cmd/backup.go b/cmd/backup.go index f5911455d..5cd9142fb 100644 --- a/cmd/backup.go +++ b/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{ diff --git a/cmd/hook.go b/cmd/hook.go index c8448d5f9..602690c63 100644 --- a/cmd/hook.go +++ b/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" ) diff --git a/cmd/import.go b/cmd/import.go index f71e4b18f..726359eea 100644 --- a/cmd/import.go +++ b/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 ( diff --git a/cmd/restore.go b/cmd/restore.go index 4b9cbed25..36e49fa2d 100644 --- a/cmd/restore.go +++ b/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{ diff --git a/cmd/serv.go b/cmd/serv.go index 763dc8646..d89ad5bdd 100644 --- a/cmd/serv.go +++ b/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" ) diff --git a/cmd/web.go b/cmd/web.go index a0463939d..86cb77322 100644 --- a/cmd/web.go +++ b/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" diff --git a/gogs.go b/gogs.go index 639454941..ccf1b6ab7 100644 --- a/gogs.go +++ b/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" diff --git a/models/action.go b/models/action.go index d830a36fe..e1378e997 100644 --- a/models/action.go +++ b/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 diff --git a/models/admin.go b/models/admin.go index 045728e4f..bad7a3bf0 100644 --- a/models/admin.go +++ b/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 diff --git a/models/attachment.go b/models/attachment.go index 4ba6adcb0..583cb10b6 100644 --- a/models/attachment.go +++ b/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. diff --git a/models/comment.go b/models/comment.go index 7a46f6f86..d18b14df9 100644 --- a/models/comment.go +++ b/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. diff --git a/models/git_diff.go b/models/git_diff.go index 7af7ee831..f8282940f 100644 --- a/models/git_diff.go +++ b/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 { diff --git a/models/issue.go b/models/issue.go index 6bcda7a99..789165c46 100644 --- a/models/issue.go +++ b/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 ( diff --git a/models/issue_label.go b/models/issue_label.go index 9136b81a1..096bba25e 100644 --- a/models/issue_label.go +++ b/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})") diff --git a/models/issue_mail.go b/models/issue_mail.go index d04472618..25f580d9b 100644 --- a/models/issue_mail.go +++ b/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 { diff --git a/models/login_source.go b/models/login_source.go index 29977fa34..03e6d6a3a 100644 --- a/models/login_source.go +++ b/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 diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 7acd7259d..2f6f828f1 100644 --- a/models/migrations/migrations.go +++ b/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! diff --git a/models/migrations/v15.go b/models/migrations/v15.go index 5d907582e..65b2a3139 100644 --- a/models/migrations/v15.go +++ b/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) { diff --git a/models/migrations/v16.go b/models/migrations/v16.go index 1c23dc410..c5facc81f 100644 --- a/models/migrations/v16.go +++ b/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) { diff --git a/models/milestone.go b/models/milestone.go index 206798e68..dbba03123 100644 --- a/models/milestone.go +++ b/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. diff --git a/models/mirror.go b/models/mirror.go index 2200d7772..4820520e2 100644 --- a/models/mirror.go +++ b/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) diff --git a/models/models.go b/models/models.go index 1d0d5740a..2eea56b12 100644 --- a/models/models.go +++ b/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. diff --git a/models/pull.go b/models/pull.go index f46d69fcb..5f7cbb579 100644 --- a/models/pull.go +++ b/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) diff --git a/models/release.go b/models/release.go index 993fa19a5..1d387fb43 100644 --- a/models/release.go +++ b/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. diff --git a/models/repo.go b/models/repo.go index b12ed58e2..c9cf64c5f 100644 --- a/models/repo.go +++ b/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() diff --git a/models/repo_branch.go b/models/repo_branch.go index de0ee26dd..b0c7d55df 100644 --- a/models/repo_branch.go +++ b/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 { diff --git a/models/repo_editor.go b/models/repo_editor.go index a9990c992..3d01de6e2 100644 --- a/models/repo_editor.go +++ b/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" ) // ___________ .___.__ __ ___________.__.__ diff --git a/models/repo_test.go b/models/repo_test.go index 2da5d8398..76025a4ce 100644 --- a/models/repo_test.go +++ b/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) { diff --git a/models/ssh_key.go b/models/ssh_key.go index aedf42b90..b8a5095bb 100644 --- a/models/ssh_key.go +++ b/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 ( diff --git a/models/ssh_key_test.go b/models/ssh_key_test.go index 1cda60c50..537f16b03 100644 --- a/models/ssh_key_test.go +++ b/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() { diff --git a/models/token.go b/models/token.go index d47545ae4..c18a66160 100644 --- a/models/token.go +++ b/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. diff --git a/models/user.go b/models/user.go index dadda2521..13f37f6b1 100644 --- a/models/user.go +++ b/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 diff --git a/models/webhook.go b/models/webhook.go index a1f8c343e..e4e774909 100644 --- a/models/webhook.go +++ b/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) diff --git a/models/webhook_discord.go b/models/webhook_discord.go index e403399a7..e452043c1 100644 --- a/models/webhook_discord.go +++ b/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 { diff --git a/models/webhook_slack.go b/models/webhook_slack.go index 46e8ef9ad..e092d221a 100644 --- a/models/webhook_slack.go +++ b/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 { diff --git a/models/wiki.go b/models/wiki.go index 20285e3d9..24d079387 100644 --- a/models/wiki.go +++ b/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() diff --git a/modules/auth/auth.go b/pkg/auth/auth.go similarity index 97% rename from modules/auth/auth.go rename to pkg/auth/auth.go index 42995ae3c..fd4d71c9e 100644 --- a/modules/auth/auth.go +++ b/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 { diff --git a/modules/auth/ldap/README.md b/pkg/auth/ldap/README.md similarity index 100% rename from modules/auth/ldap/README.md rename to pkg/auth/ldap/README.md diff --git a/modules/auth/ldap/ldap.go b/pkg/auth/ldap/ldap.go similarity index 100% rename from modules/auth/ldap/ldap.go rename to pkg/auth/ldap/ldap.go diff --git a/modules/auth/pam/pam.go b/pkg/auth/pam/pam.go similarity index 100% rename from modules/auth/pam/pam.go rename to pkg/auth/pam/pam.go diff --git a/modules/auth/pam/pam_stub.go b/pkg/auth/pam/pam_stub.go similarity index 100% rename from modules/auth/pam/pam_stub.go rename to pkg/auth/pam/pam_stub.go diff --git a/modules/avatar/avatar.go b/pkg/avatar/avatar.go similarity index 100% rename from modules/avatar/avatar.go rename to pkg/avatar/avatar.go diff --git a/modules/avatar/avatar_test.go b/pkg/avatar/avatar_test.go similarity index 100% rename from modules/avatar/avatar_test.go rename to pkg/avatar/avatar_test.go diff --git a/modules/base/base.go b/pkg/base/base.go similarity index 100% rename from modules/base/base.go rename to pkg/base/base.go diff --git a/modules/base/file.go b/pkg/base/file.go similarity index 100% rename from modules/base/file.go rename to pkg/base/file.go diff --git a/modules/base/tool.go b/pkg/base/tool.go similarity index 99% rename from modules/base/tool.go rename to pkg/base/tool.go index 7186e59d2..800be8449 100644 --- a/modules/base/tool.go +++ b/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. diff --git a/modules/bindata/bindata.go b/pkg/bindata/bindata.go similarity index 100% rename from modules/bindata/bindata.go rename to pkg/bindata/bindata.go diff --git a/modules/context/api.go b/pkg/context/api.go similarity index 95% rename from modules/context/api.go rename to pkg/context/api.go index a499ec3cd..a1c80bd1d 100644 --- a/modules/context/api.go +++ b/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 { diff --git a/modules/context/api_org.go b/pkg/context/api_org.go similarity index 100% rename from modules/context/api_org.go rename to pkg/context/api_org.go diff --git a/modules/context/auth.go b/pkg/context/auth.go similarity index 96% rename from modules/context/auth.go rename to pkg/context/auth.go index 746771791..642a320b1 100644 --- a/modules/context/auth.go +++ b/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 { diff --git a/modules/context/context.go b/pkg/context/context.go similarity index 97% rename from modules/context/context.go rename to pkg/context/context.go index d434bad1d..b33778337 100644 --- a/modules/context/context.go +++ b/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. diff --git a/modules/context/org.go b/pkg/context/org.go similarity index 98% rename from modules/context/org.go rename to pkg/context/org.go index 3cde8d637..55c2ed04d 100644 --- a/modules/context/org.go +++ b/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 { diff --git a/modules/context/repo.go b/pkg/context/repo.go similarity index 99% rename from modules/context/repo.go rename to pkg/context/repo.go index c93c0ded5..00f0eaa1e 100644 --- a/modules/context/repo.go +++ b/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 { diff --git a/modules/cron/cron.go b/pkg/cron/cron.go similarity index 97% rename from modules/cron/cron.go rename to pkg/cron/cron.go index 79d7b76c3..419be06b9 100644 --- a/modules/cron/cron.go +++ b/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() diff --git a/modules/form/admin.go b/pkg/form/admin.go similarity index 100% rename from modules/form/admin.go rename to pkg/form/admin.go diff --git a/modules/form/auth.go b/pkg/form/auth.go similarity index 100% rename from modules/form/auth.go rename to pkg/form/auth.go diff --git a/modules/form/form.go b/pkg/form/form.go similarity index 100% rename from modules/form/form.go rename to pkg/form/form.go diff --git a/modules/form/org.go b/pkg/form/org.go similarity index 100% rename from modules/form/org.go rename to pkg/form/org.go diff --git a/modules/form/repo.go b/pkg/form/repo.go similarity index 100% rename from modules/form/repo.go rename to pkg/form/repo.go diff --git a/modules/form/user.go b/pkg/form/user.go similarity index 100% rename from modules/form/user.go rename to pkg/form/user.go diff --git a/modules/httplib/httplib.go b/pkg/httplib/httplib.go similarity index 100% rename from modules/httplib/httplib.go rename to pkg/httplib/httplib.go diff --git a/modules/mailer/mail.go b/pkg/mailer/mail.go similarity index 98% rename from modules/mailer/mail.go rename to pkg/mailer/mail.go index 955432944..20e2b309b 100644 --- a/modules/mailer/mail.go +++ b/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 ( diff --git a/modules/mailer/mailer.go b/pkg/mailer/mailer.go similarity index 99% rename from modules/mailer/mailer.go rename to pkg/mailer/mailer.go index 5eb689444..4c0960d67 100644 --- a/modules/mailer/mailer.go +++ b/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 { diff --git a/modules/markup/markdown.go b/pkg/markup/markdown.go similarity index 98% rename from modules/markup/markdown.go rename to pkg/markup/markdown.go index c325f19f4..3414a58c2 100644 --- a/modules/markup/markdown.go +++ b/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. diff --git a/modules/markup/markdown_test.go b/pkg/markup/markdown_test.go similarity index 98% rename from modules/markup/markdown_test.go rename to pkg/markup/markdown_test.go index 8f048df8a..a4bf074fd 100644 --- a/modules/markup/markdown_test.go +++ b/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) { diff --git a/modules/markup/markup.go b/pkg/markup/markup.go similarity index 99% rename from modules/markup/markup.go rename to pkg/markup/markup.go index a1c862a9f..5c92b74a8 100644 --- a/modules/markup/markup.go +++ b/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. diff --git a/modules/markup/markup_test.go b/pkg/markup/markup_test.go similarity index 99% rename from modules/markup/markup_test.go rename to pkg/markup/markup_test.go index 8352911b2..d3d720912 100644 --- a/modules/markup/markup_test.go +++ b/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) { diff --git a/modules/markup/sanitizer.go b/pkg/markup/sanitizer.go similarity index 97% rename from modules/markup/sanitizer.go rename to pkg/markup/sanitizer.go index 8a88f761e..63ead6dfc 100644 --- a/modules/markup/sanitizer.go +++ b/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 diff --git a/modules/markup/sanitizer_test.go b/pkg/markup/sanitizer_test.go similarity index 96% rename from modules/markup/sanitizer_test.go rename to pkg/markup/sanitizer_test.go index 2bd7d537d..ae341accd 100644 --- a/modules/markup/sanitizer_test.go +++ b/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) { diff --git a/modules/process/manager.go b/pkg/process/manager.go similarity index 100% rename from modules/process/manager.go rename to pkg/process/manager.go diff --git a/modules/setting/miniwinsvc.go b/pkg/setting/miniwinsvc.go similarity index 100% rename from modules/setting/miniwinsvc.go rename to pkg/setting/miniwinsvc.go diff --git a/modules/setting/setting.go b/pkg/setting/setting.go similarity index 99% rename from modules/setting/setting.go rename to pkg/setting/setting.go index aeb644ac5..6ce716eac 100644 --- a/modules/setting/setting.go +++ b/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 diff --git a/modules/ssh/ssh.go b/pkg/ssh/ssh.go similarity index 99% rename from modules/ssh/ssh.go rename to pkg/ssh/ssh.go index 1b95e3bc0..d35260211 100644 --- a/modules/ssh/ssh.go +++ b/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 { diff --git a/modules/sync/exclusive_pool.go b/pkg/sync/exclusive_pool.go similarity index 100% rename from modules/sync/exclusive_pool.go rename to pkg/sync/exclusive_pool.go diff --git a/modules/sync/status_pool.go b/pkg/sync/status_pool.go similarity index 100% rename from modules/sync/status_pool.go rename to pkg/sync/status_pool.go diff --git a/modules/sync/unique_queue.go b/pkg/sync/unique_queue.go similarity index 100% rename from modules/sync/unique_queue.go rename to pkg/sync/unique_queue.go diff --git a/modules/template/highlight/highlight.go b/pkg/template/highlight/highlight.go similarity index 97% rename from modules/template/highlight/highlight.go rename to pkg/template/highlight/highlight.go index e823b4286..05029a4a1 100644 --- a/modules/template/highlight/highlight.go +++ b/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 ( diff --git a/modules/template/template.go b/pkg/template/template.go similarity index 98% rename from modules/template/template.go rename to pkg/template/template.go index faae266ba..61c47b8c0 100644 --- a/modules/template/template.go +++ b/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 { diff --git a/modules/user/user.go b/pkg/user/user.go similarity index 100% rename from modules/user/user.go rename to pkg/user/user.go diff --git a/routers/admin/admin.go b/routers/admin/admin.go index 3433e6f73..cd1f438ed 100644 --- a/routers/admin/admin.go +++ b/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 ( diff --git a/routers/admin/auths.go b/routers/admin/auths.go index a6610e5d2..255c13b19 100644 --- a/routers/admin/auths.go +++ b/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 ( diff --git a/routers/admin/notice.go b/routers/admin/notice.go index 5117676fa..2fb04ffc7 100644 --- a/routers/admin/notice.go +++ b/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 ( diff --git a/routers/admin/orgs.go b/routers/admin/orgs.go index 320007210..0150f33c9 100644 --- a/routers/admin/orgs.go +++ b/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" ) diff --git a/routers/admin/repos.go b/routers/admin/repos.go index 4f688a928..0eefbade1 100644 --- a/routers/admin/repos.go +++ b/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 ( diff --git a/routers/admin/users.go b/routers/admin/users.go index 442b938ed..0cb72000d 100644 --- a/routers/admin/users.go +++ b/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" ) diff --git a/routers/api/v1/admin/org.go b/routers/api/v1/admin/org.go index e82fc3ed6..f5c4a95c6 100644 --- a/routers/api/v1/admin/org.go +++ b/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" ) diff --git a/routers/api/v1/admin/org_repo.go b/routers/api/v1/admin/org_repo.go index 050f4577b..02ff35baa 100644 --- a/routers/api/v1/admin/org_repo.go +++ b/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 { diff --git a/routers/api/v1/admin/org_team.go b/routers/api/v1/admin/org_team.go index c0f3487e1..dfed0c86a 100644 --- a/routers/api/v1/admin/org_team.go +++ b/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" ) diff --git a/routers/api/v1/admin/repo.go b/routers/api/v1/admin/repo.go index 0f0c3862d..8b1999372 100644 --- a/routers/api/v1/admin/repo.go +++ b/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" ) diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go index 3a3c206d4..7565ab2c4 100644 --- a/routers/api/v1/admin/user.go +++ b/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" ) diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 3e83c5598..d4aa8aee9 100644 --- a/routers/api/v1/api.go +++ b/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" diff --git a/routers/api/v1/convert/utils.go b/routers/api/v1/convert/utils.go index f34fb3d2b..d0beab3d7 100644 --- a/routers/api/v1/convert/utils.go +++ b/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. diff --git a/routers/api/v1/misc/markdown.go b/routers/api/v1/misc/markdown.go index 4ef0ddf1a..d4419d577 100644 --- a/routers/api/v1/misc/markdown.go +++ b/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 diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go index 7b2cfcd1d..3b3576a72 100644 --- a/routers/api/v1/org/org.go +++ b/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" ) diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index 70f8d8420..8b0f40087 100644 --- a/routers/api/v1/org/team.go +++ b/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" ) diff --git a/routers/api/v1/repo/branch.go b/routers/api/v1/repo/branch.go index 1d60b7d14..df9500404 100644 --- a/routers/api/v1/repo/branch.go +++ b/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" ) diff --git a/routers/api/v1/repo/collaborators.go b/routers/api/v1/repo/collaborators.go index c3af5bbc4..ff109be51 100644 --- a/routers/api/v1/repo/collaborators.go +++ b/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) { diff --git a/routers/api/v1/repo/file.go b/routers/api/v1/repo/file.go index 5da91d9ef..81c399f68 100644 --- a/routers/api/v1/repo/file.go +++ b/routers/api/v1/repo/file.go @@ -8,7 +8,7 @@ import ( "github.com/gogits/git-module" "github.com/gogits/gogs/models" - "github.com/gogits/gogs/modules/context" + "github.com/gogits/gogs/pkg/context" "github.com/gogits/gogs/routers/repo" ) diff --git a/routers/api/v1/repo/hook.go b/routers/api/v1/repo/hook.go index 1fcd87353..6a4ec85f0 100644 --- a/routers/api/v1/repo/hook.go +++ b/routers/api/v1/repo/hook.go @@ -13,7 +13,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" "github.com/gogits/gogs/routers/api/v1/convert" ) diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index ffb52b9c3..5e233a201 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -12,8 +12,8 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/setting" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/setting" ) func listIssues(ctx *context.APIContext, opts *models.IssuesOptions) { diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go index 4934302fa..04ecd216f 100644 --- a/routers/api/v1/repo/issue_comment.go +++ b/routers/api/v1/repo/issue_comment.go @@ -9,7 +9,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" ) func ListIssueComments(ctx *context.APIContext) { diff --git a/routers/api/v1/repo/issue_label.go b/routers/api/v1/repo/issue_label.go index dec64f413..06c52dc58 100644 --- a/routers/api/v1/repo/issue_label.go +++ b/routers/api/v1/repo/issue_label.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 ListIssueLabels(ctx *context.APIContext) { diff --git a/routers/api/v1/repo/key.go b/routers/api/v1/repo/key.go index 563dac261..df1a8bb80 100644 --- a/routers/api/v1/repo/key.go +++ b/routers/api/v1/repo/key.go @@ -10,8 +10,8 @@ import ( api "github.com/gogits/go-gogs-client" "github.com/gogits/gogs/models" - "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/setting" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/routers/api/v1/convert" ) diff --git a/routers/api/v1/repo/label.go b/routers/api/v1/repo/label.go index 981eaef15..32c1924b2 100644 --- a/routers/api/v1/repo/label.go +++ b/routers/api/v1/repo/label.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" ) func ListLabels(ctx *context.APIContext) { diff --git a/routers/api/v1/repo/milestone.go b/routers/api/v1/repo/milestone.go index bd408f638..5133d19b3 100644 --- a/routers/api/v1/repo/milestone.go +++ b/routers/api/v1/repo/milestone.go @@ -10,7 +10,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" ) func ListMilestones(ctx *context.APIContext) { diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 326ff25e6..d7109f78b 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -13,9 +13,9 @@ 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/modules/setting" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/form" + "github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/routers/api/v1/convert" ) diff --git a/routers/api/v1/user/app.go b/routers/api/v1/user/app.go index 165f6eb8e..ebba7f099 100644 --- a/routers/api/v1/user/app.go +++ b/routers/api/v1/user/app.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" ) // https://github.com/gogits/go-gogs-client/wiki/Users#list-access-tokens-for-a-user diff --git a/routers/api/v1/user/email.go b/routers/api/v1/user/email.go index 168f383a3..c8b4ce1b5 100644 --- a/routers/api/v1/user/email.go +++ b/routers/api/v1/user/email.go @@ -8,8 +8,8 @@ import ( api "github.com/gogits/go-gogs-client" "github.com/gogits/gogs/models" - "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/setting" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/routers/api/v1/convert" ) diff --git a/routers/api/v1/user/follower.go b/routers/api/v1/user/follower.go index 58a162444..814f10f41 100644 --- a/routers/api/v1/user/follower.go +++ b/routers/api/v1/user/follower.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" ) func responseApiUsers(ctx *context.APIContext, users []*models.User) { diff --git a/routers/api/v1/user/key.go b/routers/api/v1/user/key.go index 941cfb605..22df75482 100644 --- a/routers/api/v1/user/key.go +++ b/routers/api/v1/user/key.go @@ -9,8 +9,8 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/setting" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/routers/api/v1/convert" "github.com/gogits/gogs/routers/api/v1/repo" ) diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go index b1f06ec71..d797c650b 100644 --- a/routers/api/v1/user/user.go +++ b/routers/api/v1/user/user.go @@ -11,7 +11,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 Search(ctx *context.APIContext) { diff --git a/routers/dev/template.go b/routers/dev/template.go index ee81f3804..081ab4a0a 100644 --- a/routers/dev/template.go +++ b/routers/dev/template.go @@ -6,9 +6,9 @@ package dev 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" ) func TemplatePreview(ctx *context.Context) { diff --git a/routers/home.go b/routers/home.go index b928bc608..cb59850ab 100644 --- a/routers/home.go +++ b/routers/home.go @@ -8,9 +8,9 @@ import ( "github.com/Unknwon/paginater" "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/user" ) diff --git a/routers/install.go b/routers/install.go index 9d9bb6d18..eb17f900d 100644 --- a/routers/install.go +++ b/routers/install.go @@ -21,16 +21,16 @@ import ( "github.com/gogits/git-module" "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/form" - "github.com/gogits/gogs/modules/mailer" - "github.com/gogits/gogs/modules/markup" - "github.com/gogits/gogs/modules/setting" - "github.com/gogits/gogs/modules/ssh" - "github.com/gogits/gogs/modules/template/highlight" - "github.com/gogits/gogs/modules/user" + "github.com/gogits/gogs/pkg/base" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/cron" + "github.com/gogits/gogs/pkg/form" + "github.com/gogits/gogs/pkg/mailer" + "github.com/gogits/gogs/pkg/markup" + "github.com/gogits/gogs/pkg/setting" + "github.com/gogits/gogs/pkg/ssh" + "github.com/gogits/gogs/pkg/template/highlight" + "github.com/gogits/gogs/pkg/user" ) const ( diff --git a/routers/org/members.go b/routers/org/members.go index 2f059c8c5..edc0c76c5 100644 --- a/routers/org/members.go +++ b/routers/org/members.go @@ -10,9 +10,9 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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 ( diff --git a/routers/org/org.go b/routers/org/org.go index cf49733b4..07249db5c 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -8,10 +8,10 @@ import ( log "gopkg.in/clog.v1" "github.com/gogits/gogs/models" - "github.com/gogits/gogs/modules/form" - "github.com/gogits/gogs/modules/base" - "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/setting" + "github.com/gogits/gogs/pkg/form" + "github.com/gogits/gogs/pkg/base" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/setting" ) const ( diff --git a/routers/org/setting.go b/routers/org/setting.go index 5a07e2cb7..9a5331f44 100644 --- a/routers/org/setting.go +++ b/routers/org/setting.go @@ -11,10 +11,10 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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/base" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/form" + "github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/routers/user" ) diff --git a/routers/org/teams.go b/routers/org/teams.go index abd2fd9ec..ba40c6d45 100644 --- a/routers/org/teams.go +++ b/routers/org/teams.go @@ -12,9 +12,9 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "github.com/gogits/gogs/modules/base" - "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/form" + "github.com/gogits/gogs/pkg/base" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/form" ) const ( diff --git a/routers/repo/branch.go b/routers/repo/branch.go index d9a45fbab..786dc0688 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -12,8 +12,8 @@ import ( "github.com/gogits/git-module" "github.com/gogits/gogs/models" - "github.com/gogits/gogs/modules/base" - "github.com/gogits/gogs/modules/context" + "github.com/gogits/gogs/pkg/base" + "github.com/gogits/gogs/pkg/context" ) const ( diff --git a/routers/repo/commit.go b/routers/repo/commit.go index 21e5e9162..2b5fc86f7 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -11,9 +11,9 @@ import ( "github.com/gogits/git-module" "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 ( diff --git a/routers/repo/download.go b/routers/repo/download.go index 3c253f905..95a0224e4 100644 --- a/routers/repo/download.go +++ b/routers/repo/download.go @@ -10,9 +10,9 @@ import ( "github.com/gogits/git-module" - "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" ) func ServeData(ctx *context.Context, name string, reader io.Reader) error { diff --git a/routers/repo/editor.go b/routers/repo/editor.go index 480ff8761..9bbee51c6 100644 --- a/routers/repo/editor.go +++ b/routers/repo/editor.go @@ -15,11 +15,11 @@ import ( "github.com/gogits/git-module" "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/setting" - "github.com/gogits/gogs/modules/template" + "github.com/gogits/gogs/pkg/base" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/form" + "github.com/gogits/gogs/pkg/setting" + "github.com/gogits/gogs/pkg/template" ) const ( diff --git a/routers/repo/http.go b/routers/repo/http.go index 9b893f27f..328cfa39f 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -23,9 +23,9 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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 ( diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 8ab7c7075..f7dc4b1ba 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -19,11 +19,11 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "github.com/gogits/gogs/modules/base" - "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/form" - "github.com/gogits/gogs/modules/markup" - "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/markup" + "github.com/gogits/gogs/pkg/setting" ) const ( diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 51d34877e..987e703cf 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -16,10 +16,10 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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/base" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/form" + "github.com/gogits/gogs/pkg/setting" ) const ( diff --git a/routers/repo/release.go b/routers/repo/release.go index 4d2011810..692d7b2f0 100644 --- a/routers/repo/release.go +++ b/routers/repo/release.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/markup" - "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/markup" + "github.com/gogits/gogs/pkg/setting" ) const ( diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 4604d643b..3626ac49c 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -17,10 +17,10 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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/base" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/form" + "github.com/gogits/gogs/pkg/setting" ) const ( diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 95cce36bc..de2553341 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -15,11 +15,11 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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" ) const ( diff --git a/routers/repo/view.go b/routers/repo/view.go index 6785b7596..abfe9333b 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -18,12 +18,12 @@ import ( "github.com/gogits/git-module" "github.com/gogits/gogs/models" - "github.com/gogits/gogs/modules/base" - "github.com/gogits/gogs/modules/context" - "github.com/gogits/gogs/modules/markup" - "github.com/gogits/gogs/modules/setting" - "github.com/gogits/gogs/modules/template" - "github.com/gogits/gogs/modules/template/highlight" + "github.com/gogits/gogs/pkg/base" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/markup" + "github.com/gogits/gogs/pkg/setting" + "github.com/gogits/gogs/pkg/template" + "github.com/gogits/gogs/pkg/template/highlight" ) const ( diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go index bc4701dd6..aa76de2d0 100644 --- a/routers/repo/webhook.go +++ b/routers/repo/webhook.go @@ -16,10 +16,10 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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/base" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/form" + "github.com/gogits/gogs/pkg/setting" ) const ( diff --git a/routers/repo/wiki.go b/routers/repo/wiki.go index 44b5079a6..643ad7b5f 100644 --- a/routers/repo/wiki.go +++ b/routers/repo/wiki.go @@ -12,10 +12,10 @@ import ( "github.com/gogits/git-module" "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/markup" + "github.com/gogits/gogs/pkg/base" + "github.com/gogits/gogs/pkg/context" + "github.com/gogits/gogs/pkg/form" + "github.com/gogits/gogs/pkg/markup" ) const ( diff --git a/routers/user/auth.go b/routers/user/auth.go index be15e56eb..35e737426 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -13,11 +13,11 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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" ) const ( diff --git a/routers/user/home.go b/routers/user/home.go index ce8c2243d..b85d3064c 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -13,9 +13,9 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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 ( diff --git a/routers/user/profile.go b/routers/user/profile.go index ee5f97c53..10c48878f 100644 --- a/routers/user/profile.go +++ b/routers/user/profile.go @@ -13,9 +13,9 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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/repo" ) diff --git a/routers/user/setting.go b/routers/user/setting.go index e1fabb48b..777a812eb 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -14,11 +14,11 @@ import ( "github.com/gogits/gogs/models" "github.com/gogits/gogs/models/errors" - "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" ) const (