https://github.com/arran4/gorillamuxlogic
Some very simple gorilla mux logic for `mux.MatcherFunc`
https://github.com/arran4/gorillamuxlogic
go golang gorilla gorilla-mux http web
Last synced: 7 months ago
JSON representation
Some very simple gorilla mux logic for `mux.MatcherFunc`
- Host: GitHub
- URL: https://github.com/arran4/gorillamuxlogic
- Owner: arran4
- License: mit
- Created: 2023-08-11T14:15:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-11T14:19:42.000Z (about 2 years ago)
- Last Synced: 2025-01-13T18:24:37.075Z (9 months ago)
- Topics: go, golang, gorilla, gorilla-mux, http, web
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Gorilla Mux Logic
Simple primitive enabling logic like this:
```go
package mainimport (
. "github.com/arran4/gorillamuxlogic"
"github.com/gorilla/mux"
)func main() {
mux.NewRouter().
Use(UserMiddleware).
HandleFunc("/blog/{blog}/comment/{comment}/edit", blogsCommentEditPage).
MatcherFunc(Or(RequiredScopes("administrator"), CommentAuthor())).
Methods("POST")
}
```Provides functions:
```go
func And(matchers ...mux.MatcherFunc) mux.MatcherFuncfunc Or(matchers ...mux.MatcherFunc) mux.MatcherFunc
func Not(matcher mux.MatcherFunc) mux.MatcherFunc
```