client

package
v1.0.0 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: 23 Imported by: 0

Documentation

Overview

Package client implements endpoint client

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 fetches configs, caching results in-memory.

func New

func New(docLoader ld.DocumentLoader, casReader casReader, opts ...Option) (*Client, error)

New create new endpoint client.

func (*Client) GetDomainFromIPNS

func (cs *Client) GetDomainFromIPNS(uri string) (string, error)

GetDomainFromIPNS get domain from ipns.

func (*Client) GetEndpoint

func (cs *Client) GetEndpoint(domain string) (*models.Endpoint, error)

GetEndpoint fetches endpoints from domain, caching the value.

func (*Client) GetEndpointFromAnchorOrigin

func (cs *Client) GetEndpointFromAnchorOrigin(didURI string) (*models.Endpoint, error)

GetEndpointFromAnchorOrigin fetches endpoints from anchor origin, caching the value.

func (*Client) ResolveDomainForDID

func (cs *Client) ResolveDomainForDID(id string) (string, error)

ResolveDomainForDID resolves the origin domain for the given DID.

type Option

type Option func(opts *Client)

Option is a config service instance option.

func WithAuthToken

func WithAuthToken(authToken string) Option

WithAuthToken add auth token.

func WithAuthTokenProvider

func WithAuthTokenProvider(p authTokenProvider) Option

WithAuthTokenProvider add auth token provider.

func WithCacheLifetime

func WithCacheLifetime(lifetime time.Duration) Option

WithCacheLifetime option defines the lifetime of an object in the cache.

func WithCacheSize

func WithCacheSize(size int) Option

WithCacheSize option defines the cache size.

func WithDIDWebHTTP

func WithDIDWebHTTP(enable bool) Option

WithDIDWebHTTP use did web http.

func WithDisableProofCheck

func WithDisableProofCheck(disable bool) Option

WithDisableProofCheck disable proof check.

func WithHTTPClient

func WithHTTPClient(httpClient httpClient) Option

WithHTTPClient option is for custom http client.

func WithNamespace

func WithNamespace(namespace string) Option

WithNamespace option is for custom namespace.

func WithPublicKeyFetcher

func WithPublicKeyFetcher(pkf verifiable.PublicKeyFetcher) Option

WithPublicKeyFetcher sets the public key fetcher. If not set then the default fetcher is used.

func WithVDR

func WithVDR(r vdrapi.Registry) Option

WithVDR option is for custom VDR. If not specified then the default VDR is used.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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