go: github.com/stellar/go/clients/federation Index | Files

package federation

import "github.com/stellar/go/clients/federation"

Index

Package Files

client.go main.go

Constants

const FederationResponseMaxSize = 100 * 1024

FederationResponseMaxSize is the maximum size of response from a federation server

Variables

var DefaultPublicNetClient = &Client{
    HTTP:        http.DefaultClient,
    Horizon:     hc.DefaultPublicNetClient,
    StellarTOML: stellartoml.DefaultClient,
}

DefaultPublicNetClient is a default federation client for pubnet

var DefaultTestNetClient = &Client{
    HTTP:        http.DefaultClient,
    Horizon:     hc.DefaultTestNetClient,
    StellarTOML: stellartoml.DefaultClient,
}

DefaultTestNetClient is a default federation client for testnet

type Client Uses

type Client struct {
    StellarTOML StellarTOML
    HTTP        HTTP
    Horizon     Horizon
    AllowHTTP   bool
}

Client represents a client that is capable of resolving a federation request using the internet.

func (*Client) ForwardRequest Uses

func (c *Client) ForwardRequest(domain string, fields url.Values) (*proto.NameResponse, error)

ForwardRequest performs a federated lookup following to the stellar federation protocol using the "forward" type request.

func (*Client) LookupByAccountID Uses

func (c *Client) LookupByAccountID(aid string) (*proto.IDResponse, error)

LookupByAccountID performs a federated lookup following to the stellar federation protocol using the "id" type request. The provided strkey-encoded account id is used to resolve what server the request should be made against.

func (*Client) LookupByAddress Uses

func (c *Client) LookupByAddress(addy string) (*proto.NameResponse, error)

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.

type ClientInterface Uses

type ClientInterface interface {
    LookupByAddress(addy string) (*proto.NameResponse, error)
    LookupByAccountID(aid string) (*proto.IDResponse, error)
    ForwardRequest(domain string, fields url.Values) (*proto.NameResponse, error)
}

type HTTP Uses

type HTTP interface {
    Get(url string) (*http.Response, error)
}

HTTP represents the http client that a federation client uses to make http requests.

type Horizon Uses

type Horizon interface {
    HomeDomainForAccount(aid string) (string, error)
}

Horizon represents a horizon client that can be consulted for data when needed as part of the federation protocol

type StellarTOML Uses

type StellarTOML interface {
    GetStellarToml(domain string) (*stellartoml.Response, error)
}

StellarTOML represents a client that can resolve a given domain name to stellar.toml file. The response is used to find the federation server that a query should be made against.

Package federation imports 11 packages (graph) and is imported by 22 packages. Updated 2019-07-02. Refresh now. Tools for package owners.