did

package
v0.1.6-0...-5c25bcb Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// NameSpace for did store.
	NameSpace = "didstore"
)
View Source
const StoreName = "didconnection"

StoreName DID connection store name.

Variables

View Source
var ErrNotFound = errors.New("did not found under given key")

ErrNotFound signals that the entry for the given DID and key is not present in the store.

Functions

This section is empty.

Types

type ConnectionStore

type ConnectionStore struct {
	// contains filtered or unexported fields
}

ConnectionStore stores DIDs indexed by key.

func NewConnectionStore

func NewConnectionStore(ctx connectionProvider) (*ConnectionStore, error)

NewConnectionStore returns a new did lookup ConnectionStore.

func (*ConnectionStore) GetDID

func (c *ConnectionStore) GetDID(key string) (string, error)

GetDID gets the DID stored under the given key.

func (*ConnectionStore) SaveDID

func (c *ConnectionStore) SaveDID(did string, keys ...string) error

SaveDID saves a DID, indexed using the given public keys.

func (*ConnectionStore) SaveDIDByResolving

func (c *ConnectionStore) SaveDIDByResolving(did string, keys ...string) error

SaveDIDByResolving resolves a DID using the VDR then saves the map from keys -> did

keys: fallback keys in case the DID can't be resolved

func (*ConnectionStore) SaveDIDFromDoc

func (c *ConnectionStore) SaveDIDFromDoc(doc *diddoc.Doc) error

SaveDIDFromDoc saves a map from a did doc's keys to the did.

type Record

type Record struct {
	Name string `json:"name,omitempty"`
	ID   string `json:"id,omitempty"`
}

Record model.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store stores did doc.

func New

func New(ctx provider) (*Store, error)

New returns a new did store.

func (*Store) GetDID

func (s *Store) GetDID(id string) (*did.Doc, error)

GetDID retrieves a didDoc based on ID.

func (*Store) GetDIDByName

func (s *Store) GetDIDByName(name string) (string, error)

GetDIDByName retrieves did id based on name.

func (*Store) GetDIDRecords

func (s *Store) GetDIDRecords() []*Record

GetDIDRecords retrieves the didDoc records containing name and didID.

func (*Store) SaveDID

func (s *Store) SaveDID(name string, didDoc *did.Doc) error

SaveDID saves a did doc.

Jump to

Keyboard shortcuts

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