func MakeMapper(t TokenMapperFn, a AmountMapperFn) MapperFn {
	return func(r request.Request) (string, int64, error) {
		token, err := t(r)
		if err != nil {
			return "", -1, err
		}
		amount, err := a(r)
		if err != nil {
			return "", -1, err
		}
		return token, amount, nil
	}
}
Make mapper constructs the mapper function out of two functions - token mapper and amount mapper
package limit
import (
	"fmt"
	"github.com/mailgun/vulcan/middleware"
	"github.com/mailgun/vulcan/request"
	"strings"
)
type Limiter interface {
	middleware.Middleware
}
type MapperFn func(r request.Request) (token string, amount int64, err error)
type TokenMapperFn func(r request.Request) (token string, err error)
type AmountMapperFn func(r request.Request) (amount int64, err error)
func MapClientIp(req request.Request) (string, int64, error) {
	t, err := RequestToClientIp(req)
	return t, 1, err
}
func MapRequestHost(req request.Request) (string, int64, error) {
	t, err := RequestToHost(req)
	return t, 1, err
}
func MakeMapRequestHeader(header string) MapperFn {
	return MakeMapper(MakeRequestToHeader(header), RequestToCount)
}
func VariableToMapper(variable string) (MapperFn, error) {
	tokenMapper, err := MakeTokenMapperFromVariable(variable)
	if err != nil {
		return nil, err
	}
	return MakeMapper(tokenMapper, RequestToCount), nil
}