client

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 15 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 implements webfinger client.

func New

func New(opts ...Option) *Client

New creates new webfinger client.

func (*Client) GetLedgerType

func (c *Client) GetLedgerType(uri string) (string, error)

GetLedgerType returns ledger type for the VCT service.

func (*Client) GetWebCASURL

func (c *Client) GetWebCASURL(domainWithScheme, cid string) (*url.URL, error)

GetWebCASURL gets the WebCAS URL for cid from domainWithScheme using WebFinger.

func (*Client) HasSupportedLedgerType

func (c *Client) HasSupportedLedgerType(uri string) (bool, error)

HasSupportedLedgerType returns true if domain supports configured ledger type.

func (*Client) ResolveLog

func (c *Client) ResolveLog(uri string) (*url.URL, error)

ResolveLog returns VCT log for the given service URI.

func (*Client) ResolveWebFingerResource

func (c *Client) ResolveWebFingerResource(domainWithScheme, resource string) (restapi.JRD, error)

ResolveWebFingerResource attempts to resolve the given WebFinger resource from domainWithScheme.

type Option

type Option func(opts *Client)

Option is a webfinger client instance option.

func WithCacheLifetime

func WithCacheLifetime(lifetime time.Duration) Option

WithCacheLifetime option defines the lifetime of an object in the cache. If we end-up with multiple caches that require different lifetime we may have to add different cache lifetime options.

func WithCacheSize

func WithCacheSize(size int) Option

WithCacheSize option defines the cache size.

func WithDIDDomainResolver

func WithDIDDomainResolver(resolver didDomainResolver) Option

WithDIDDomainResolver option sets the domain resolver.

func WithHTTPClient

func WithHTTPClient(httpClient httpClient) Option

WithHTTPClient option is for custom http client.

Jump to

Keyboard shortcuts

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