graph

package
v1.0.0 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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anchor

type Anchor struct {
	Info *linkset.Link
	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(anchorLinkset *linkset.Linkset) (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) (*linkset.Linkset, error)

Read reads anchor.

type Providers

type Providers struct {
	CasWriter            casWriter
	CasResolver          casResolver
	DocLoader            ld.DocumentLoader
	AnchorLinksetBuilder anchorLinksetBuilder
}

Providers for anchor graph.

Jump to

Keyboard shortcuts

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