func NewResolver(inputType string) (Resolver, error) {
	if constructor, ok := resolvers[inputType]; ok {
		return constructor(), nil
	}
	return nil, errors.Errorf("failed to create resolver due to unknown input type %v", inputType)
}
NewResolver returns a MySQL connection info resolver depending on the input type
package db
import (
	"context"
	"github.com/pkg/errors"
	"github.com/uber/storagetapper/log"
)
type ConnectionType int
const (
	Master ConnectionType = iota
	Slave
)
func (c ConnectionType) String() string {
	return [...]string{"master", "slave"}[c]
}
type resolverConstructor func() Resolver
var resolvers map[string]resolverConstructor
type Addr struct {
	Name string `json:"name"`
	Host string `json:"host"`
	Port uint16 `json:"port"`
	User string `json:"user"`
	Pwd  string `json:"pwd"`
	DB   string `json:"db"`
}
type Loc struct {
	Cluster string
	Service string
	Name    string
}
type TableLoc struct {
	Service string
	Cluster string
	DB      string
	Table   string
	Input   string
	Output  string
	Version int
}
func (d *Loc) LogFields() log.Logger {
	return log.WithFields(log.Fields{
		"cluster": d.Cluster,
		"service": d.Service,
		"db":      d.Name,
	})
}
type Resolver interface {
	GetInfo(context.Context, *Loc, ConnectionType) (*Addr, error)
	GetEnumerator(context.Context, string, string, string, string) (Enumerator, error)
	IsValidConn(ctx context.Context, dbl *Loc, connType ConnectionType, addr *Addr) bool
}