func (e *BuiltinEnumerator) Next() bool {
	e.current++
	return e.current < len(e.data)
}
Next is used to check if anymore values can be returned by the enumerator
package db
import (
	"context"
	"fmt"
	"github.com/pkg/errors"
	"github.com/uber/storagetapper/log"
	"github.com/uber/storagetapper/types"
)
func init() {
	registerResolver(types.InputMySQL, NewBuiltinResolver)
}
var BuiltinResolveCluster func(*Loc, ConnectionType) (*Addr, error)
type BuiltinResolver struct {
}
func NewBuiltinResolver() Resolver {
	return &BuiltinResolver{}
}
func (r *BuiltinResolver) GetInfo(ctx context.Context, dbl *Loc, connType ConnectionType) (*Addr, error) {
	if BuiltinResolveCluster != nil {
		return BuiltinResolveCluster(dbl, connType)
	}
	return nil, fmt.Errorf("no builtin resolver set")
}
func (r *BuiltinResolver) IsValidConn(ctx context.Context, dbl *Loc, connType ConnectionType, addr *Addr) bool {
	l := log.WithFields(log.Fields{"service": dbl.Service, "cluster": dbl.Cluster, "db": dbl.Name, "host": addr.Host, "port": addr.Port})
	conn, err := r.GetInfo(ctx, dbl, connType)
	if err != nil {
		l.Warnf(errors.Wrap(err, "Failed to fetch connection info to compare, assuming valid connection").Error())
		return true
	}
	if conn.Host != addr.Host || conn.Port != addr.Port {
		l.Warnf("Invalid connection due to mismatched host, port")
		return false
	}
	return true
}
type BuiltinEnumerator struct {
	current int
	data    []*Loc
}
func (r *BuiltinResolver) GetEnumerator(ctx context.Context, svc, cluster, sdb, table string) (Enumerator, error) {
	if svc == "" || sdb == "" || table == "" || cluster == "" {
		err := errors.New("service name, cluster name, DB name or table name not provided")
		return nil, err
	}
	loc := Loc{Cluster: cluster, Service: svc, Name: sdb}
	return &BuiltinEnumerator{
		current: -1, data: []*Loc{&loc},
	}, nil
}