func MustRegister(name string, f Factory) {
	if err := Register(name, f); err != nil {
		panic(err)
	}
}
MustRegister registers a filter, panic if failed.
package filter
import (
	"fmt"
	"strconv"
	"github.com/koron/nvgd/resource"
)
type Factory func(*resource.Resource, Params) (*resource.Resource, error)
var filters = map[string]Factory{}
func Register(name string, f Factory) error {
	_, ok := filters[name]
	if ok {
		return fmt.Errorf("duplicated filter name %q", name)
	}
	filters[name] = f
	return nil
}