Documentation ¶
Overview ¶
Package client implements endpoint client
Index ¶
- type Client
- type Option
- func WithAuthToken(authToken string) Option
- func WithAuthTokenProvider(p authTokenProvider) Option
- func WithCacheLifetime(lifetime time.Duration) Option
- func WithCacheSize(size int) Option
- func WithDIDWebHTTP(enable bool) Option
- func WithDisableProofCheck(disable bool) Option
- func WithHTTPClient(httpClient httpClient) Option
- func WithNamespace(namespace string) Option
- func WithPublicKeyFetcher(pkf verifiable.PublicKeyFetcher) Option
- func WithVDR(r vdrapi.Registry) Option
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 ¶
GetDomainFromIPNS get domain from ipns.
func (*Client) GetEndpoint ¶
GetEndpoint fetches endpoints from domain, caching the value.
func (*Client) GetEndpointFromAnchorOrigin ¶
GetEndpointFromAnchorOrigin fetches endpoints from anchor origin, caching the value.
type Option ¶
type Option func(opts *Client)
Option is a config service instance option.
func WithAuthTokenProvider ¶
func WithAuthTokenProvider(p authTokenProvider) Option
WithAuthTokenProvider add auth token provider.
func WithCacheLifetime ¶
WithCacheLifetime option defines the lifetime of an object in the cache.
func WithCacheSize ¶
WithCacheSize option defines the cache size.
func WithDisableProofCheck ¶
WithDisableProofCheck disable proof check.
func WithHTTPClient ¶
func WithHTTPClient(httpClient httpClient) Option
WithHTTPClient option is for custom http client.
func WithNamespace ¶
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.