gorillamuxlogic

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 2 Imported by: 2

README

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func And

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

func Not

func Not(matcher mux.MatcherFunc) mux.MatcherFunc

func Or

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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL