Skip to content

Commit

Permalink
Add set middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertWHurst committed Sep 24, 2024
1 parent fc77ba9 commit dfd8b2c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions middleware/set/set.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package set

import "github.com/RobertWHurst/navaros"

func Middleware[V any](key string, value V) func(ctx *navaros.Context) {
return func(ctx *navaros.Context) {
ctx.Set(key, value)
ctx.Next()
}
}

0 comments on commit dfd8b2c

Please sign in to comment.