util

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MinOakIdentifierParts = 4

MinOakIdentifierParts is minimum number of parts in Oak 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

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

GetAnchorOrigin returns anchor origin from document metadata.

func GetHint

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

GetHint returns hint from id.

func GetMethodMetadata

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

GetMethodMetadata retrieves method metadata from document metadata.

func GetOperationsAfterCanonicalReference

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

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

func GetPublishedOperationsFromMetadata

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

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

GetUnpublishedOperationsFromMetadata will retrieve unpublished operations from metadata.

func IsDID

func IsDID(uri string) bool

IsDID return true if the given URI is a DID.

func ParseKeyURI

func ParseKeyURI(keyIRI string) (did, keyID string, err 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