summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-04-26 08:08:28 +0200
committerGitHub <noreply@github.com>2023-04-26 02:08:28 -0400
commitfb37eefa282543fd8ce63c361cd4cf0dfac9943c (patch)
tree2a88297945f49000dc7c0340c75ae74efa0e4816 /modules
parent4d5c803f8b71ccf3182d89584196783e2338e365 (diff)
downloadgitea-fb37eefa282543fd8ce63c361cd4cf0dfac9943c.tar.gz
gitea-fb37eefa282543fd8ce63c361cd4cf0dfac9943c.zip
Add API for License templates (#23009)
This adds a API for getting License templates. This tries to be as close to the [GitHub API](https://docs.github.com/en/rest/licenses?apiVersion=2022-11-28) as possible, but Gitea does not support all features that GitHub has. I think they should been added, but this out f the scope of this PR. You should merge #23006 before this PR for security reasons.
Diffstat (limited to 'modules')
-rw-r--r--modules/structs/miscellaneous.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/structs/miscellaneous.go b/modules/structs/miscellaneous.go
index 8acea84d6c..53d10a9907 100644
--- a/modules/structs/miscellaneous.go
+++ b/modules/structs/miscellaneous.go
@@ -72,6 +72,22 @@ type ServerVersion struct {
Version string `json:"version"`
}
+// LicensesListEntry is used for the API
+type LicensesTemplateListEntry struct {
+ Key string `json:"key"`
+ Name string `json:"name"`
+ URL string `json:"url"`
+}
+
+// LicensesInfo contains information about a License
+type LicenseTemplateInfo struct {
+ Key string `json:"key"`
+ Name string `json:"name"`
+ URL string `json:"url"`
+ Implementation string `json:"implementation"`
+ Body string `json:"body"`
+}
+
// APIError is an api error with a message
type APIError struct {
Message string `json:"message"`