vct

package
v1.0.2 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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLogEndpointNotConfigured indicates that a log endpoint has not been configured.
	ErrLogEndpointNotConfigured = errors.New("log endpoint not configured")

	// ErrDisabled indicates that this Oak instance has no VCT.
	ErrDisabled = errors.New("disabled")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents VCT client.

func New

func New(configRetriever configRetriever, signer signer, metrics metricsProvider, opts ...Option) *Client

New returns the client.

func (*Client) GetLogEndpoint

func (c *Client) GetLogEndpoint() (string, error)

GetLogEndpoint returns the log endpoint or error, ErrLogEndpointNotConfigured, if a log endpoint has not been configured.

func (*Client) HealthCheck

func (c *Client) HealthCheck() error

HealthCheck check health.

func (*Client) Witness

func (c *Client) Witness(anchorCred []byte) ([]byte, error)

Witness credentials.

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient represents HTTP client.

type Option

type Option func(opts *Client)

Option is a config client instance option.

func WithAuthReadToken

func WithAuthReadToken(authToken string) Option

WithAuthReadToken add auth token.

func WithAuthWriteToken

func WithAuthWriteToken(authToken string) Option

WithAuthWriteToken add auth token.

func WithDocumentLoader

func WithDocumentLoader(loader ld.DocumentLoader) Option

WithDocumentLoader allows providing document loader.

func WithHTTPClient

func WithHTTPClient(client HTTPClient) Option

WithHTTPClient allows providing HTTP client.

type Proof

type Proof struct {
	Context interface{}      `json:"@context"`
	Proof   verifiable.Proof `json:"proof"`
}

Proof represents response.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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