util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const MinOrbIdentifierParts = 4

MinOrbIdentifierParts is minimum number of parts in Orb identifier.

Variables

This section is empty.

Functions

func BetweenStrings

func BetweenStrings(value, first, second string) (string, error)

BetweenStrings returns string between first and second string.

func GetAnchorOrigin added in v1.0.0

func GetAnchorOrigin(metadata document.Metadata) (string, error)

GetAnchorOrigin returns anchor origin from document metadata.

func GetEndpointFromDIDWeb added in v1.0.0

func GetEndpointFromDIDWeb(id string, noTLS bool) (string, error)

GetEndpointFromDIDWeb returns the HTTP/HTTPS endpoint URL from the given did:web DID.

func GetHint added in v1.0.0

func GetHint(id, namespace, suffix string) (string, error)

GetHint returns hint from id.

func GetMethodMetadata added in v1.0.0

func GetMethodMetadata(metadata document.Metadata) (map[string]interface{}, error)

GetMethodMetadata retrieves method metadata from document metadata.

func GetOperationsAfterCanonicalReference added in v1.0.0

func GetOperationsAfterCanonicalReference(ref string, anchorOps []*operation.AnchoredOperation) []*operation.AnchoredOperation

GetOperationsAfterCanonicalReference retrieves operations after canonical references. assumption: operations are sorted by transaction time

func GetPublishedOperationsFromMetadata added in v1.0.0

func GetPublishedOperationsFromMetadata(metadata document.Metadata) ([]*operation.AnchoredOperation, error)

GetPublishedOperationsFromMetadata will retrieve published operations from metadata.

func GetSuffix

func GetSuffix(id string) (string, error)

GetSuffix returns suffix from id.

func GetUnpublishedOperationsFromMetadata added in v1.0.0

func GetUnpublishedOperationsFromMetadata(metadata document.Metadata) ([]*operation.AnchoredOperation, error)

GetUnpublishedOperationsFromMetadata will retrieve unpublished operations from metadata.

func IsDID added in v1.0.0

func IsDID(uri string) bool

IsDID return true if the given URI is a DID.

func ParseKeyURI added in v1.0.0

func ParseKeyURI(keyIRI string) (string, string, error)

ParseKeyURI parses the key IRI and returns the DID and the key ID.

Types

This section is empty.

Jump to

Keyboard shortcuts

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