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.
This commit is contained in:
parent
4d5c803f8b
commit
fb37eefa28
6 changed files with 270 additions and 0 deletions
|
@ -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"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue