func (f *Filter) RequestModifier(id string) martian.RequestModifier {
	f.mu.RLock()
	defer f.mu.RUnlock()
	return f.reqmods[id]
}
RequestModifier retrieves the RequestModifier for the given ID. Returns nil
if no modifier exists for the given ID.
package auth
import (
	"fmt"
	"net/http"
	"sync"
	"github.com/google/martian/v3"
)
type Filter struct {
	authRequired bool
	mu      sync.RWMutex
	reqmods map[string]martian.RequestModifier
	resmods map[string]martian.ResponseModifier
}
func NewFilter() *Filter {
	return &Filter{
		reqmods: make(map[string]martian.RequestModifier),
		resmods: make(map[string]martian.ResponseModifier),
	}
}
func (f *Filter) SetAuthRequired(required bool) {
	f.authRequired = required
}
func (f *Filter) SetRequestModifier(id string, reqmod martian.RequestModifier) error {
	f.mu.Lock()
	defer f.mu.Unlock()
	if reqmod != nil {
		f.reqmods[id] = reqmod
	} else {
		delete(f.reqmods, id)
	}
	return nil
}
func (f *Filter) SetResponseModifier(id string, resmod martian.ResponseModifier) error {
	f.mu.Lock()
	defer f.mu.Unlock()
	if resmod != nil {
		f.resmods[id] = resmod
	} else {
		delete(f.resmods, id)
	}
	return nil
}