paysharestoml

package
v0.0.0-...-55c481f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2022 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const PaysharesTomlMaxSize = 5 * 1024

PaysharesTomlMaxSize is the maximum size of payshares.toml file

View Source
const WellKnownPath = "/.well-known/payshares.toml"

WellKnownPath represents the url path at which the payshares.toml file should exist to conform to the federation protocol.

Variables

View Source
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 Payshares.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 Payshares.toml file using the internet.

func (*Client) GetPaysharesToml

func (c *Client) GetPaysharesToml(domain string) (resp *Response, err error)

GetPaysharesToml returns payshares.toml file for a given domain

func (*Client) GetPaysharesTomlByAddress

func (c *Client) GetPaysharesTomlByAddress(addy string) (*Response, error)

GetPaysharesTomlByAddress returns payshares.toml file of a domain fetched from a given address

type HTTP

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

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

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is a mockable paysharestoml client.

func (*MockClient) GetPaysharesToml

func (m *MockClient) GetPaysharesToml(domain string) (*Response, error)

GetPaysharesToml is a mocking a method

func (*MockClient) GetPaysharesTomlByAddress

func (m *MockClient) GetPaysharesTomlByAddress(address string) (*Response, error)

GetPaysharesTomlByAddress 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 payshares.toml file

func GetPaysharesToml

func GetPaysharesToml(domain string) (*Response, error)

GetPaysharesToml returns payshares.toml file for a given domain

func GetPaysharesTomlByAddress

func GetPaysharesTomlByAddress(addy string) (*Response, error)

GetPaysharesTomlByAddress returns payshares.toml file of a domain fetched from a given address

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL