httpbinding

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 12 Imported by: 20

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 added in v0.1.8

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 added in v0.1.9

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 added in v0.1.6

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

Create did doc.

func (*VDR) Deactivate added in v0.1.6

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 added in v0.1.6

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