summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/admin
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-12-17 22:57:41 -0500
committerUnknwon <u@gogs.io>2015-12-17 22:57:41 -0500
commit1c9dd11ba71ff261f52bf1d31aba6812d0680179 (patch)
tree9862b1736199877f613200450c897ecec6a79f06 /routers/api/v1/admin
parent1e7e092992164acc243ec01859509eaa2207196d (diff)
downloadgitea-1c9dd11ba71ff261f52bf1d31aba6812d0680179.tar.gz
gitea-1c9dd11ba71ff261f52bf1d31aba6812d0680179.zip
#1692 API: admin create repo
Diffstat (limited to 'routers/api/v1/admin')
-rw-r--r--routers/api/v1/admin/repos.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/routers/api/v1/admin/repos.go b/routers/api/v1/admin/repos.go
new file mode 100644
index 0000000000..7a6b2af20b
--- /dev/null
+++ b/routers/api/v1/admin/repos.go
@@ -0,0 +1,23 @@
+// Copyright 2015 The Gogs Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package admin
+
+import (
+ api "github.com/gogits/go-gogs-client"
+
+ "github.com/gogits/gogs/modules/middleware"
+ "github.com/gogits/gogs/routers/api/v1/repo"
+ "github.com/gogits/gogs/routers/api/v1/user"
+)
+
+// https://github.com/gogits/go-gogs-client/wiki/Administration-Repositories#create-a-new-repository
+func CreateRepo(ctx *middleware.Context, form api.CreateRepoOption) {
+ owner := user.GetUserByParams(ctx)
+ if ctx.Written() {
+ return
+ }
+
+ repo.CreateUserRepo(ctx, owner, form)
+}