client

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0 Imports: 22 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, opts ...Option) (*Client, error)

New create new endpoint client.

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.

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 WithCASReader

func WithCASReader(casReader casReader) Option

WithCASReader option is for custom CAS reader.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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