httpbinding

package
v0.0.0-...-57c6170 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VersionIDOpt version id opt this option is not mandatory.
	VersionIDOpt = "versionID"
	// VersionTimeOpt version time opt this option is not mandatory.
	VersionTimeOpt = "versionTime"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Accept

type Accept func(method string) bool

Accept is method to accept did method.

type Option

type Option func(opts *VDR)

Option configures the peer vdr.

func WithAccept

func WithAccept(accept Accept) Option

WithAccept option is for accept did method.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient option is for custom http client.

func WithResolveAuthToken

func WithResolveAuthToken(authToken string) Option

WithResolveAuthToken add auth token for resolve.

func WithResolveAuthTokenProvider

func WithResolveAuthTokenProvider(p authTokenProvider) Option

WithResolveAuthTokenProvider add auth token provider.

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout option is for definition of HTTP(s) timeout value of DID Resolver.

type VDR

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

VDR via HTTP(s) endpoint.

func New

func New(endpointURL string, opts ...Option) (*VDR, error)

New creates new DID Resolver.

func (*VDR) Accept

func (v *VDR) Accept(method string, opts ...vdrapi.DIDMethodOption) bool

Accept did method - attempt to resolve any method.

func (*VDR) Close

func (v *VDR) Close() error

Close frees resources being maintained by vdr.

func (*VDR) Create

func (v *VDR) Create(didDoc *did.Doc, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error)

Create did doc.

func (*VDR) Deactivate

func (v *VDR) Deactivate(didID string, opts ...vdrapi.DIDMethodOption) error

Deactivate did doc.

func (*VDR) Read

func (v *VDR) Read(didID string, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error)

Read implements didresolver.DidMethod.Read interface (https://w3c-ccg.github.io/did-resolution/#resolving-input)

func (*VDR) Update

func (v *VDR) Update(didDoc *did.Doc, opts ...vdrapi.DIDMethodOption) error

Update did doc.

Jump to

Keyboard shortcuts

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