Documentation ¶
Index ¶
Examples ¶
Constants ¶
const PaydexTomlMaxSize = 100 * 1024
PaydexTomlMaxSize is the maximum size of paydex.toml file
const WellKnownPath = "/.well-known/paydex.toml"
WellKnownPath represents the url path at which the paydex.toml file should exist to conform to the federation protocol.
Variables ¶
var DefaultClient = &Client{HTTP: http.DefaultClient}
DefaultClient is a default client using the default parameters
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // HTTP is the http client used when resolving a Paydex.toml file HTTP HTTP // UseHTTP forces the client to resolve against servers using plain HTTP. // Useful for debugging. UseHTTP bool }
Client represents a client that is capable of resolving a Paydex.toml file using the internet.
func (*Client) GetPaydexToml ¶
GetPaydexToml returns paydex.toml file for a given domain
Example ¶
ExampleGetTOML gets the paydex.toml file for coins.asia
_, err := DefaultClient.GetPaydexToml("coins.asia") if err != nil { log.Fatal(err) }
Output:
type ClientInterface ¶
type MockClient ¶
MockClient is a mockable paydextoml client.
func (*MockClient) GetPaydexToml ¶
func (m *MockClient) GetPaydexToml(domain string) (*Response, error)
GetPaydexToml is a mocking a method
func (*MockClient) GetPaydexTomlByAddress ¶
func (m *MockClient) GetPaydexTomlByAddress(address string) (*Response, error)
GetPaydexTomlByAddress is a mocking a method
type Response ¶
type Response struct { AuthServer string `toml:"AUTH_SERVER"` FederationServer string `toml:"FEDERATION_SERVER"` EncryptionKey string `toml:"ENCRYPTION_KEY"` SigningKey string `toml:"SIGNING_KEY"` }
Response represents the results of successfully resolving a paydex.toml file
func GetPaydexToml ¶
GetPaydexToml returns paydex.toml file for a given domain
func GetPaydexTomlByAddress ¶
GetPaydexTomlByAddress returns paydex.toml file of a domain fetched from a given address