forked from forgejo/forgejo
Same perl replacement as https://github.com/go-gitea/gitea/pull/25686 but for 1.20 to ease future backporting.
This commit is contained in:
parent
4e310133f9
commit
24e64fe372
233 changed files with 729 additions and 729 deletions
|
@ -25,7 +25,7 @@ import (
|
|||
packages_service "code.gitea.io/gitea/services/packages"
|
||||
)
|
||||
|
||||
func jsonResponse(ctx *context.Context, status int, obj interface{}) {
|
||||
func jsonResponse(ctx *context.Context, status int, obj any) {
|
||||
resp := ctx.Resp
|
||||
resp.Header().Set("Content-Type", "application/vnd.pub.v2+json")
|
||||
resp.WriteHeader(status)
|
||||
|
@ -34,7 +34,7 @@ func jsonResponse(ctx *context.Context, status int, obj interface{}) {
|
|||
}
|
||||
}
|
||||
|
||||
func apiError(ctx *context.Context, status int, obj interface{}) {
|
||||
func apiError(ctx *context.Context, status int, obj any) {
|
||||
type Error struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
|
@ -60,10 +60,10 @@ type packageVersions struct {
|
|||
}
|
||||
|
||||
type versionMetadata struct {
|
||||
Version string `json:"version"`
|
||||
ArchiveURL string `json:"archive_url"`
|
||||
Published time.Time `json:"published"`
|
||||
Pubspec interface{} `json:"pubspec,omitempty"`
|
||||
Version string `json:"version"`
|
||||
ArchiveURL string `json:"archive_url"`
|
||||
Published time.Time `json:"published"`
|
||||
Pubspec any `json:"pubspec,omitempty"`
|
||||
}
|
||||
|
||||
func packageDescriptorToMetadata(baseURL string, pd *packages_model.PackageDescriptor) *versionMetadata {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue