pkarr

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client for publishing and fetching BEP44 messages to and from a Pkarr relay server.

func NewClient

func NewClient(relay string, client *http.Client) *Client

NewClient creates a new Pkarr relay client with the given relay URL and HTTP client.

func (*Client) Fetch

func (r *Client) Fetch(didID string) (*bep44.Message, error)

Fetch fetches a signed BEP44 message from a Pkarr relay server.

func (*Client) FetchWithContext

func (r *Client) FetchWithContext(ctx context.Context, didID string) (*bep44.Message, error)

FetchWithContext fetches a signed BEP44 message from a Pkarr relay server.

func (*Client) Put

func (r *Client) Put(didID string, msg *bep44.Message) error

Put Publishes a signed BEP44 message to a Pkarr relay server. https://github.com/Nuhvi/pkarr/blob/main/design/relays.md

didID - The DID identifier, used as the key in the DHT; it is the z-base-32 encoding of the Identity Key. bep44Message - The BEP44 message to be published, containing the signed DNS packet.

Returns an error if the request fails.

func (*Client) PutWithContext

func (r *Client) PutWithContext(ctx context.Context, didID string, msg *bep44.Message) error

PutWithContext same as put but with context

Jump to

Keyboard shortcuts

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