client

package
v1.0.0-rc6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: Apache-2.0 Imports: 24 Imported by: 4

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 added in v1.0.0

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 added in v1.0.0

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 added in v1.0.0

func WithAuthTokenProvider(p authTokenProvider) Option

WithAuthTokenProvider add auth token provider.

func WithCacheLifetime added in v0.1.3

func WithCacheLifetime(lifetime time.Duration) Option

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

func WithCacheSize added in v0.1.3

func WithCacheSize(size int) Option

WithCacheSize option defines the cache size.

func WithDIDWebHTTP added in v1.0.0

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 added in v1.0.0

func WithPublicKeyFetcher(pkf verifiable.PublicKeyFetcher) Option

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

func WithVDR added in v1.0.0

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