repo.go 645 B

1234567891011121314151617181920212223
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package admin
  5. import (
  6. api "github.com/gogits/go-gogs-client"
  7. "github.com/gogits/gogs/modules/context"
  8. "github.com/gogits/gogs/routers/api/v1/repo"
  9. "github.com/gogits/gogs/routers/api/v1/user"
  10. )
  11. // https://github.com/gogits/go-gogs-client/wiki/Administration-Repositories#create-a-new-repository
  12. func CreateRepo(ctx *context.APIContext, form api.CreateRepoOption) {
  13. owner := user.GetUserByParams(ctx)
  14. if ctx.Written() {
  15. return
  16. }
  17. repo.CreateUserRepo(ctx, owner, form)
  18. }