1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00

Add context.FindClosest(n) to find closest paths - useful for 404 pages to suggest valid pages

Former-commit-id: 90ff7c9da5369df5bd99fbbecf9955a8c555fea5
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-12-16 02:00:42 +02:00
parent 4efe9004fa
commit a3f944b884
11 changed files with 137 additions and 30 deletions

View File

@@ -60,4 +60,8 @@ type Application interface {
// RouteExists reports whether a particular route exists
// It will search from the current subdomain of context's host, if not inside the root domain.
RouteExists(ctx Context, method, path string) bool
// FindClosestPaths returns a list of "n" paths close to "path" under the given "subdomain".
//
// Order may change.
FindClosestPaths(subdomain, searchPath string, n int) []string
}