v1.0.0 Latest Latest

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

Go to latest
Published: Aug 18, 2021 License: Apache-2.0 Imports: 6 Imported by: 0



Package resolver implements a universal resolver compatible REST API

The configuration for this resolver are the following:

	"pattern": "^(did:cosmos:.+)$",
	"url": "http://uni-resolver-driver-did-uport:8081/",
	"testIdentifiers": [



View Source
const (
	// ResolutionInvalidDID - the DID supplied to the DID resolution function does not conform to valid syntax.
	ResolutionInvalidDID = "invalidDid"
	// ResolutionNotFound - the DID resolver was unable to find the DID document resulting from this resolution request.
	ResolutionNotFound = "notFound"
	// ResolutionRepresentationNotSupported - the representation requested via the accept input metadata property is not supported
	ResolutionRepresentationNotSupported = "representationNotSupported"

Error types for resolution as described in the resolution metadata

View Source
const (
	ResolutionJSONType   = "application/json"
	ResolutionJSONLDType = "application/ld+json"

Accepted content types


This section is empty.


func ResolveAccountDID

func ResolveAccountDID(did string) (didDoc types.DidDocument, didMeta types.DidMetadata, err error)

ResolveAccountDID generates a DID document from an address


type DidResolutionReply

type DidResolutionReply struct {
	Document           types.DidDocument  `json:"didDocument,omitempty"`
	Metadata           types.DidMetadata  `json:"didDocumentMetadata,omitempty"`
	ResolutionMetadata ResolutionMetadata `json:"didResolutionMetadata,omitempty"`

DidResolutionReply contains the answer to a identifier endpoint

func ResolveRepresentation

func ResolveRepresentation(ctx client.Context, did string, opts ResolutionOption) (drr DidResolutionReply)

ResolveRepresentation resolve a did document with a specific representation

type ResolutionMetadata

type ResolutionMetadata struct {
	ContentType     string            `json:"contentType,omitempty"`
	ResolutionError string            `json:"error,omitempty"`
	DidProperties   map[string]string `json:"did,omitempty"`

ResolutionMetadata are info about the resolution

func ResolutionErr

func ResolutionErr(err string) ResolutionMetadata

ResolutionErr helper to get a resolution metadata for an error

func ResolutionOk

func ResolutionOk(contentType string) ResolutionMetadata

ResolutionOk helper to get a resolution metadata for a successful resolution

type ResolutionOption

type ResolutionOption struct {
	Accept string `json:"accept,omitempty"`

ResolutionOption are parametes for the resolver

Jump to

Keyboard shortcuts

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