client

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

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(domain string) (string, error)

GetLedgerType returns ledger type for VCT domain.

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(domain string) (bool, error)

HasSupportedLedgerType returns true if domain supports configured ledger type.

func (*Client) ResolveLog added in v1.0.0

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

ResolveLog returns VCT log for domain.

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 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