dochandler

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package dochandler performs document operation processing and document resolution.

the supplied create request is used directly to generate and return a resolved document. In this case the supplied create request is subject to the same validation as in a create operation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentHandler

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

DocumentHandler implements document handler.

func New

func New(namespace string, opts ...Option) (*DocumentHandler, error)

New creates a new document handler with the context.

func (*DocumentHandler) Namespace

func (r *DocumentHandler) Namespace() string

Namespace returns the namespace of the document handler.

func (*DocumentHandler) ProcessOperation

func (r *DocumentHandler) ProcessOperation(operationBuffer []byte) (*document.ResolutionResult, error)

ProcessOperation validates create operation and returns resolution result of that create operation. Only create operation is supported.

func (*DocumentHandler) ResolveDocument

func (r *DocumentHandler) ResolveDocument(longFormDID string,
	_ ...document.ResolutionOption) (*document.ResolutionResult, error)

ResolveDocument resolves long form DID format.

Long Form DID format: did:METHOD:<did-suffix>:Base64url(JCS({suffix-data-object, delta-object}))

The <suffix-data-object> and <delta-object> are used to generate and return resolved DID Document. In this case the supplied delta and suffix objects are subject to the same validation as during processing create operation.

type Option

type Option func(opts *DocumentHandler)

Option is an option for document handler.

func WithCurrentProtocolVersion

func WithCurrentProtocolVersion(version string) Option

WithCurrentProtocolVersion sets optional current protocol versions. Defaults to the latest in the protocol versions list.

func WithProtocolVersions

func WithProtocolVersions(versions []string) Option

WithProtocolVersions sets optional client protocol versions.

Directories

Path Synopsis
protocol
protocolversion
clientregistry/mocks
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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