Skip to content

Commit

Permalink
Move sdk structs to modules/structs (#6905)
Browse files Browse the repository at this point in the history
* move sdk structs to moduels/structs

* fix tests

* fix fmt

* fix swagger

* fix vendor
  • Loading branch information
lunny authored May 11, 2019
1 parent 1658cd0 commit 34eee25
Show file tree
Hide file tree
Showing 188 changed files with 717 additions and 2,144 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module code.gitea.io/gitea
go 1.12

require (
code.gitea.io/sdk v0.0.0-20190510041517-9251befd3702
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/PuerkitoBio/goquery v0.0.0-20170324135448-ed7d758e9a34
github.com/RoaringBitmap/roaring v0.4.7 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
cloud.google.com/go v0.30.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
code.gitea.io/sdk v0.0.0-20190419065346-2858b80da5f7 h1:YggbbCVgggcOjKYmcB2wVOsEtJHgHUNFFJZDB6QcYTg=
code.gitea.io/sdk v0.0.0-20190419065346-2858b80da5f7/go.mod h1:5bZt0dRznpn2JysytQnV0yCru3FwDv9O5G91jo+lDAk=
code.gitea.io/sdk v0.0.0-20190510041517-9251befd3702 h1:MyOmF6QejeIZfsEQYoJVHOm1PGNyGZMAZmo6cO8Hq80=
code.gitea.io/sdk v0.0.0-20190510041517-9251befd3702/go.mod h1:5bZt0dRznpn2JysytQnV0yCru3FwDv9O5G91jo+lDAk=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/PuerkitoBio/goquery v0.0.0-20170324135448-ed7d758e9a34 h1:UsHpWO0Elp6NaWVARdZHjiYwkhrspHVEGsyIKPb9OI8=
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_branch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"testing"

api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_fork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"testing"

api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"
)

func TestCreateForkNoLogin(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_gpg_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"
"testing"

api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_helper_for_declarative_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"net/http"
"testing"

api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion integrations/api_issue_label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/stretchr/testify/assert"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"
)

func TestViewDeployKeysNoLogin(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_org_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/auth"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_releases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_file_content_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_file_create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_file_delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_file_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package integrations
import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/repofiles"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"
)

func createFileInBranch(user *models.User, repo *models.Repository, treePath, branchName string) (*api.FileResponse, error) {
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_file_update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_git_blobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_git_hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_lfs_locks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_team_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/routers/api/v1/convert"
api "code.gitea.io/sdk/gitea"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"
)

// TestAPICreateAndDeleteToken tests that token that was just created can be deleted
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_user_orgs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/api_user_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"net/http"
"testing"

api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/benchmarks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"
)

func BenchmarkRepo(b *testing.B) {
Expand Down
2 changes: 1 addition & 1 deletion integrations/links_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"testing"

"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/test"
api "code.gitea.io/sdk/gitea"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/pull_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"testing"

"code.gitea.io/gitea/models"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/repo_commits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"path"
"testing"

api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion integrations/ssh_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"time"

"code.gitea.io/gitea/modules/git"
api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions integrations/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"

"code.gitea.io/gitea/modules/setting"
"code.gitea.io/sdk/gitea"
"code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand All @@ -21,7 +21,7 @@ func TestVersion(t *testing.T) {
req := NewRequest(t, "GET", "/api/v1/version")
resp := MakeRequest(t, req, http.StatusOK)

var version gitea.ServerVersion
var version structs.ServerVersion
DecodeJSON(t, resp, &version)
assert.Equal(t, setting.AppVer, string(version.Version))
}
2 changes: 1 addition & 1 deletion models/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
api "code.gitea.io/sdk/gitea"

"github.com/Unknwon/com"
"github.com/go-xorm/builder"
Expand Down
2 changes: 1 addition & 1 deletion models/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"path"

"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
api "code.gitea.io/sdk/gitea"

"github.com/go-xorm/xorm"
gouuid "github.com/satori/go.uuid"
Expand Down
2 changes: 1 addition & 1 deletion models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
api "code.gitea.io/sdk/gitea"

"github.com/Unknwon/com"
"github.com/go-xorm/builder"
Expand Down
2 changes: 1 addition & 1 deletion models/issue_assignees.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"code.gitea.io/gitea/modules/log"

api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"
"github.com/go-xorm/xorm"
)

Expand Down
2 changes: 1 addition & 1 deletion models/issue_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"github.com/go-xorm/builder"
"github.com/go-xorm/xorm"

api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/markup"
Expand Down
2 changes: 1 addition & 1 deletion models/issue_label.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/go-xorm/xorm"

api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"
)

var labelColorPattern = regexp.MustCompile("#([a-fA-F0-9]{6})")
Expand Down
2 changes: 1 addition & 1 deletion models/issue_label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"html/template"
"testing"

api "code.gitea.io/sdk/gitea"
api "code.gitea.io/gitea/modules/structs"

"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion models/issue_milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
api "code.gitea.io/sdk/gitea"
"github.com/go-xorm/xorm"
)

Expand Down
Loading

0 comments on commit 34eee25

Please sign in to comment.