mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
update dependencies
This commit is contained in:
@@ -28,8 +28,8 @@ func configureAPI(api *iris.APIContainer) {
|
||||
/* Here is how you can inject a return value from a handler,
|
||||
in this case the "testOutput":
|
||||
api.UseResultHandler(func(next iris.ResultHandler) iris.ResultHandler {
|
||||
return func(ctx iris.Context, v interface{}) error {
|
||||
return next(ctx, map[string]interface{}{"injected": true})
|
||||
return func(ctx iris.Context, v any) error {
|
||||
return next(ctx, map[string]any{"injected": true})
|
||||
}
|
||||
})
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module github.com/kataras/iris/_examples/dependency-injection/jwt/contrib
|
||||
|
||||
go 1.24.3
|
||||
go 1.25
|
||||
|
||||
require (
|
||||
github.com/iris-contrib/middleware/jwt v0.0.0-20250207234507-372f6828ef8c
|
||||
|
||||
@@ -19,7 +19,7 @@ func register(api *iris.APIContainer) {
|
||||
j := jwt.New(jwt.Config{
|
||||
// Extract by "token" url parameter.
|
||||
Extractor: jwt.FromFirst(jwt.FromParameter("token"), jwt.FromAuthHeader),
|
||||
ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) {
|
||||
ValidationKeyGetter: func(token *jwt.Token) (any, error) {
|
||||
return secret, nil
|
||||
},
|
||||
SigningMethod: jwt.SigningMethodHS256,
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
var helloView = hero.View{
|
||||
Name: "hello/index.html",
|
||||
Data: map[string]interface{}{
|
||||
Data: map[string]any{
|
||||
"Title": "Hello Page",
|
||||
"MyMessage": "Welcome to my awesome website",
|
||||
},
|
||||
|
||||
@@ -47,7 +47,7 @@ func UpdateMovieByID(ctx iris.Context, service services.MovieService, id uint64)
|
||||
// DeleteMovieByID deletes a movie.
|
||||
// Demo:
|
||||
// curl -i -X DELETE -u admin:password http://localhost:8080/movies/1
|
||||
func DeleteMovieByID(service services.MovieService, id uint64) interface{} {
|
||||
func DeleteMovieByID(service services.MovieService, id uint64) any {
|
||||
wasDel := service.DeleteByID(id)
|
||||
if wasDel {
|
||||
// return the deleted movie's ID
|
||||
|
||||
@@ -124,7 +124,7 @@ func (h httpError) Error() string {
|
||||
return fmt.Sprintf("Status Code: %d\nReason: %s", h.Code, h.Reason)
|
||||
}
|
||||
|
||||
func fail(ctx iris.Context, statusCode int, format string, a ...interface{}) {
|
||||
func fail(ctx iris.Context, statusCode int, format string, a ...any) {
|
||||
err := httpError{
|
||||
Code: statusCode,
|
||||
Reason: fmt.Sprintf(format, a...),
|
||||
@@ -141,7 +141,7 @@ func fail(ctx iris.Context, statusCode int, format string, a ...interface{}) {
|
||||
|
||||
// JSON helper to give end-user the ability to put indention chars or filtering the response, you can do that, optionally.
|
||||
// If you'd like to see that function inside the Iris' Context itself raise a [Feature Request] issue and link this example.
|
||||
func sendJSON(ctx iris.Context, resp interface{}) (err error) {
|
||||
func sendJSON(ctx iris.Context, resp any) (err error) {
|
||||
indent := ctx.URLParamDefault("indent", " ")
|
||||
// i.e [?Name == 'John Doe'].Age # to output the [age] of a user which his name is "John Doe".
|
||||
if query := ctx.URLParam("query"); query != "" && query != "[]" {
|
||||
|
||||
Reference in New Issue
Block a user