func (c *Client) LookupByAddress(addy string) (*proto.NameResponse, error) {
	_, domain, err := address.Split(addy)
	if err != nil {
		return nil, errors.Wrap(err, "parse address failed")
	}
	fserv, err := c.getFederationServer(domain)
	if err != nil {
		return nil, errors.Wrap(err, "lookup federation server failed")
	}
	qstr := url.Values{}
	qstr.Add("type", "name")
	qstr.Add("q", addy)
	url := c.url(fserv, qstr)
	var resp proto.NameResponse
	err = c.getJSON(url, &resp)
	if err != nil {
		return nil, errors.Wrap(err, "get federation failed")
	}
	if resp.MemoType != "" && resp.Memo.String() == "" {
		return nil, errors.New("Invalid federation response (memo)")
	}
	return &resp, nil
}
LookupByAddress performs a federated lookup following to the stellar
federation protocol using the "name" type request.  The provided address is
used to resolve what server the request should be made against.  NOTE: the
"name" type is a legacy holdover from the legacy stellar network's federation
protocol. It is unfortunate.
package federation
import (
	"encoding/json"
	"fmt"
	"io"
	"net/url"
	"strings"
	"github.com/stellar/go/address"
	proto "github.com/stellar/go/protocols/federation"
	"github.com/stellar/go/support/errors"
)