mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 12:31:58 +00:00
New ':int64' and ':uint64' route path parameters - and - support the new uint64 for MVC (int64 was already supported there) - and - add ctx.Params().GetUint64 (GetInt64 was already there) - and - make the ':int or :number' to accept negative numbers with no digit limit (at low level) and rename the 'app.Macros().Int.RegisterFunc' to 'Number.RegisterFunc' because number can be any type of number not only standard go type limited - and - add alias for ':boolean' -> ':bool'. Finally, Update the examples but not the version yet, I have to provide a good README table to explain the end-developers how they can benefit by those changes and why the breaking change (which is to accept negative numbers via ':int') is for their own good and how they can make their own macro functions so they do not depend on the Iris builtn macro funcs only. More to come tomorrow, stay tuned
Former-commit-id: 3601abfc89478185afec3594375080778214283e
This commit is contained in:
@@ -16,7 +16,7 @@ type Route struct {
|
||||
Method string `json:"method"` // "GET"
|
||||
methodBckp string // if Method changed to something else (which is possible at runtime as well, via RefreshRouter) then this field will be filled with the old one.
|
||||
Subdomain string `json:"subdomain"` // "admin."
|
||||
tmpl *macro.Template // Tmpl().Src: "/api/user/{id:int}"
|
||||
tmpl *macro.Template // Tmpl().Src: "/api/user/{id:uint64}"
|
||||
// temp storage, they're appended to the Handlers on build.
|
||||
// Execution happens before Handlers, can be empty.
|
||||
beginHandlers context.Handlers
|
||||
@@ -198,7 +198,7 @@ func formatPath(path string) string {
|
||||
|
||||
// StaticPath returns the static part of the original, registered route path.
|
||||
// if /user/{id} it will return /user
|
||||
// if /user/{id}/friend/{friendid:int} it will return /user too
|
||||
// if /user/{id}/friend/{friendid:uint64} it will return /user too
|
||||
// if /assets/{filepath:path} it will return /assets.
|
||||
func (r Route) StaticPath() string {
|
||||
src := r.tmpl.Src
|
||||
|
||||
Reference in New Issue
Block a user