graph

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

type Anchor struct {
	Info *verifiable.Credential
	CID  string
}

Anchor contains anchor info plus corresponding hl.

type Graph

type Graph struct {
	*Providers
}

Graph manages anchor graph.

func New

func New(providers *Providers) *Graph

New creates new graph manager.

func (*Graph) Add

func (g *Graph) Add(vc *verifiable.Credential) (string, error)

Add adds an anchor to the anchor graph. Returns hl that contains anchor information.

func (*Graph) GetDidAnchors

func (g *Graph) GetDidAnchors(hl, suffix string) ([]Anchor, error)

GetDidAnchors returns all anchors that are referencing did suffix starting from hl.

func (*Graph) Read

func (g *Graph) Read(hl string) (*verifiable.Credential, error)

Read reads anchor.

type Providers

type Providers struct {
	CasWriter   casWriter
	CasResolver casResolver
	Pkf         verifiable.PublicKeyFetcher
	DocLoader   ld.DocumentLoader
}

Providers for anchor graph.

Jump to

Keyboard shortcuts

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