resource

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resolver

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

Resolver is used for resolving host-meta resources.

func New

func New(httpClient *http.Client, ipfsReader *ipfs.Client) *Resolver

New returns a new Resolver.

func (c *Resolver) ResolveHostMetaLink(urlToGetHostMetaFrom, linkType string) (string, error)

ResolveHostMetaLink resolves a host-meta link for a given url and linkType. The url may have an HTTP, HTTPS, or IPNS scheme. If the url has an HTTP or HTTPS scheme, then the hostname for the host-meta call will be extracted from the url argument. Example: For url = https://orb.domain1.com/services/orb, this method will look for a host-meta document at the following URL: https://orb.domain1.com/.well-known/host-meta. If the resource has an IPNS scheme, then this method will look for a host-meta document stored under that IPNS address. In both cases, the first link in the host-meta document with a matching type will have its associated href value returned.

Directories

Path Synopsis
didanchorinfo/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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