Skip to content

Some very simple gorilla mux logic for `mux.MatcherFunc`

License

Notifications You must be signed in to change notification settings

arran4/gorillamuxlogic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gorilla Mux Logic

Simple primitive enabling logic like this:

package main

import (
	. "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:

func And(matchers ...mux.MatcherFunc) mux.MatcherFunc

func Or(matchers ...mux.MatcherFunc) mux.MatcherFunc

func Not(matcher mux.MatcherFunc) mux.MatcherFunc

About

Some very simple gorilla mux logic for `mux.MatcherFunc`

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages