Logo
Explore Help
Register Sign In
Nemcio/Gogs
1
0
Fork 0
You've already forked Gogs
mirror of https://github.com/gogs/gogs.git synced 2026-03-02 18:20:57 +01:00
Code Issues Packages Projects Releases Wiki Activity
Files
copilot/support-embedded-postgres-cli
Gogs/internal/route/api/v1/convert/utils.go

16 lines
288 B
Go
Raw Permalink Normal View History

#3058 #3059 support correct page size and link header
2016-07-04 17:27:06 +08:00
package convert
import (
conf: overhaul server settings (#5928) * conf: rename package * Requires Go 1.12 * Fix lint * Fix lint * Overhaul * db: fix tests * Save my work * Fix tests * Server.UnixSocketPermission * Server.LocalRootURL * SSH settings * Server.OfflineMode * Save my work * App.Version * Remove [server] STATIC_ROOT_PATH * Server.LandingURL
2020-02-22 09:05:26 +08:00
"gogs.io/gogs/internal/conf"
#3058 #3059 support correct page size and link header
2016-07-04 17:27:06 +08:00
)
// ToCorrectPageSize makes sure page size is in allowed range.
func ToCorrectPageSize(size int) int {
if size <= 0 {
size = 10
conf: overhaul server settings (#5928) * conf: rename package * Requires Go 1.12 * Fix lint * Fix lint * Overhaul * db: fix tests * Save my work * Fix tests * Server.UnixSocketPermission * Server.LocalRootURL * SSH settings * Server.OfflineMode * Save my work * App.Version * Remove [server] STATIC_ROOT_PATH * Server.LandingURL
2020-02-22 09:05:26 +08:00
} else if size > conf.API.MaxResponseItems {
size = conf.API.MaxResponseItems
#3058 #3059 support correct page size and link header
2016-07-04 17:27:06 +08:00
}
return size
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.1 Page: 73ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API