Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶ added in v0.1.3
type Option func(opts *Resolver)
Option is a resolver option.
func WithCacheLifetime ¶ added in v0.1.3
WithCacheLifetime option defines the lifetime of an object in the cache.
func WithCacheSize ¶ added in v0.1.3
WithCacheSize option defines the cache size.
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, domainResolver domainResolver, opts ...Option) *Resolver
New returns a new Resolver. ipfsReader is optional. If not provided (is nil), then host-meta links specified with IPNS won't be resolvable.
func (*Resolver) ResolveHostMetaLink ¶
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. |