Documentation ¶
Index ¶
Constants ¶
const (
// NameSpace for did store.
NameSpace = "didstore"
)
const StoreName = "didconnection"
StoreName DID connection store name.
Variables ¶
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 interface { GetDID(key string) (string, error) SaveDID(did string, keys ...string) error SaveDIDFromDoc(doc *diddoc.Doc) error SaveDIDByResolving(did string, keys ...string) error }
ConnectionStore provides interface for storing and retrieving DIDs.
type ConnectionStoreImpl ¶
type ConnectionStoreImpl struct {
// contains filtered or unexported fields
}
ConnectionStoreImpl stores DIDs indexed by key.
func NewConnectionStore ¶
func NewConnectionStore(ctx connectionProvider) (*ConnectionStoreImpl, error)
NewConnectionStore returns a new ConnectionStore backed by provided storage and VDR.
func (*ConnectionStoreImpl) GetDID ¶
func (c *ConnectionStoreImpl) GetDID(key string) (string, error)
GetDID gets the DID stored under the given key.
func (*ConnectionStoreImpl) SaveDID ¶
func (c *ConnectionStoreImpl) SaveDID(did string, keys ...string) error
SaveDID saves a DID, indexed using the given public keys.
func (*ConnectionStoreImpl) SaveDIDByResolving ¶
func (c *ConnectionStoreImpl) 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 (*ConnectionStoreImpl) SaveDIDFromDoc ¶
func (c *ConnectionStoreImpl) SaveDIDFromDoc(doc *diddoc.Doc) error
SaveDIDFromDoc saves a map from a did doc's keys to the did.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores did doc.
func (*Store) GetDIDByName ¶
GetDIDByName retrieves did id based on name.
func (*Store) GetDIDRecords ¶
GetDIDRecords retrieves the didDoc records containing name and didID.