bench-forgejo/modules/structs
David Svantesson 1f951cdeba Add API endpoint for accessing repo topics (#7963)
* Create API endpoints for repo topics.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Generate swagger

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add documentation to functions

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Grammar fix

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix function comment

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Can't use FindTopics when looking for a single repo topic, as it doesnt use exact match

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add PUT ​/repos​/{owner}​/{repo}​/topics and remove GET ​/repos​/{owner}​/{repo}​/topics

* Ignore if topic is sent twice in same request, refactoring.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix topic dropdown with api changes.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Style fix

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Update API documentation

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Better way to handle duplicate topics in slice

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Make response element TopicName an array of strings, instead of using an array of TopicName

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add test cases for API Repo Topics.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix format of tests

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix comments

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix unit tests after adding some more topics to the test fixture.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Update models/topic.go

Limit multiple if else if ...

Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>

* Engine as first parameter in function

Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>

* Replace magic numbers with http status code constants.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix variable scope

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Test one read with login and one with token

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add some more tests

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Apply suggestions from code review

Use empty struct for efficiency

Co-Authored-By: Lauris BH <lauris@nix.lv>

* Add test case to check access for user with write access

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix access, repo admin required to change topics

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Correct first test to be without token

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Any repo reader should be able to access topics.

* No need for string pointer

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
2019-09-03 23:46:24 +08:00
..
admin_user.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
attachment.go Revert "make modules/structs as a spereate go mod (#7127)" (#7175) 2019-06-10 15:55:58 -04:00
doc.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
fork.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
git_blob.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
git_hook.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
hook.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
issue.go Display original author and URL information when showing migrated issues/comments (#7352) 2019-07-08 10:14:12 +08:00
issue_comment.go Display original author and URL information when showing migrated issues/comments (#7352) 2019-07-08 10:14:12 +08:00
issue_label.go Add missing description of label on API (#7159) 2019-06-16 20:39:52 +08:00
issue_milestone.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
issue_tracked_time.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
lfs_lock.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
miscellaneous.go API method to list all commits of a repository (#6408) 2019-08-26 16:09:10 +02:00
org.go Fixes #7023 - API Org Visibility (#7028) 2019-05-30 13:57:55 -04:00
org_member.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
org_team.go swagger/fix: []string are not enum by swagger definition (#7916) 2019-08-26 20:13:10 +02:00
org_type.go Fixes #7023 - API Org Visibility (#7028) 2019-05-30 13:57:55 -04:00
pull.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
release.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
repo.go Display original author and URL information when showing migrated issues/comments (#7352) 2019-07-08 10:14:12 +08:00
repo_branch.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
repo_collaborator.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
repo_commit.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
repo_file.go Be more strict with git arguments (#7715) 2019-08-05 21:39:39 +01:00
repo_key.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
repo_refs.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
repo_tag.go Fixes #2738 - Adds the /git/tags API endpoint (#7138) 2019-06-08 17:31:11 +03:00
repo_topic.go Add API endpoint for accessing repo topics (#7963) 2019-09-03 23:46:24 +08:00
repo_tree.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
repo_watch.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
status.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
user.go Add LastLogin to the User API (#7196) 2019-06-15 23:28:32 -04:00
user_app.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
user_email.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
user_gpgkey.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
user_key.go Move sdk structs to modules/structs (#6905) 2019-05-11 18:21:34 +08:00
utils.go Add golangci (#6418) 2019-06-12 15:41:28 -04:00