Documentation ¶
Index ¶
- Constants
- func CreateNamespaceKey(prefix, thID string) (string, error)
- type DIDRotationRecord
- type KeyPrefix
- type Lookup
- func (c *Lookup) GetConnectionIDByDIDs(myDID, theirDID string) (string, error)
- func (c *Lookup) GetConnectionRecord(connectionID string) (*Record, error)
- func (c *Lookup) GetConnectionRecordAtState(connectionID, stateID string) (*Record, error)
- func (c *Lookup) GetConnectionRecordByDIDs(myDID, theirDID string) (*Record, error)
- func (c *Lookup) GetConnectionRecordByNSThreadID(nsThreadID string) (*Record, error)
- func (c *Lookup) GetConnectionRecordByTheirDID(theirDID string) (*Record, error)
- func (c *Lookup) GetInvitation(id string, target interface{}) error
- func (c *Lookup) GetOOBv2Invitation(myDID string, target interface{}) error
- func (c *Lookup) QueryConnectionRecords() ([]*Record, error)
- type Record
- type Recorder
- func (c *Recorder) GetEvent(connectionID string) ([]byte, error)
- func (c *Recorder) RemoveConnection(connectionID string) error
- func (c *Recorder) SaveConnectionRecord(record *Record) error
- func (c *Recorder) SaveConnectionRecordWithMappings(record *Record) error
- func (c *Recorder) SaveEvent(connectionID string, data []byte) error
- func (c *Recorder) SaveInvitation(id string, invitation interface{}) error
- func (c *Recorder) SaveNamespaceThreadID(threadID, namespace, connectionID string) error
- func (c *Recorder) SaveOOBv2Invitation(myDID string, invitation interface{}) error
Constants ¶
const ( // StateNameCompleted completed state. StateNameCompleted = "completed" // MyNSPrefix namespace val my. MyNSPrefix = "my" // TheirNSPrefix namespace val their // TODO: https://github.com/hyperledger/aries-framework-go/issues/556 It will not be constant, this namespace // will need to be figured with verification key TheirNSPrefix = "their" )
const (
// Namespace is namespace of connection store name.
Namespace = "didexchange"
)
Variables ¶
This section is empty.
Functions ¶
func CreateNamespaceKey ¶
CreateNamespaceKey creates key prefix for namespace related data.
Types ¶
type DIDRotationRecord ¶ added in v0.1.8
type DIDRotationRecord struct { OldDID string `json:"oldDID,omitempty"` NewDID string `json:"newDID,omitempty"` FromPrior string `json:"fromPrior,omitempty"` }
DIDRotationRecord holds information about a DID Rotation.
type Lookup ¶
type Lookup struct {
// contains filtered or unexported fields
}
Lookup takes care of connection related persistence features.
func NewLookup ¶
NewLookup returns new connection lookup instance. Lookup is read only connection store. It provides connection record related query features.
func (*Lookup) GetConnectionIDByDIDs ¶ added in v0.1.2
GetConnectionIDByDIDs return connection id based on dids (my or their did) metadata.
func (*Lookup) GetConnectionRecord ¶
GetConnectionRecord return connection record based on the connection ID.
func (*Lookup) GetConnectionRecordAtState ¶
GetConnectionRecordAtState return connection record based on the connection ID and state.
func (*Lookup) GetConnectionRecordByDIDs ¶ added in v0.1.8
GetConnectionRecordByDIDs return connection record for completed connection based on the DIDs of the participants.
func (*Lookup) GetConnectionRecordByNSThreadID ¶
GetConnectionRecordByNSThreadID return connection record via namespaced threadID.
func (*Lookup) GetConnectionRecordByTheirDID ¶ added in v0.1.8
GetConnectionRecordByTheirDID return connection record for completed connection based on the DID of the other party.
func (*Lookup) GetInvitation ¶
GetInvitation finds and parses stored invitation to target type. TODO should avoid using target of type `interface{}` [Issue #1030].
func (*Lookup) GetOOBv2Invitation ¶ added in v0.1.8
GetOOBv2Invitation finds and parses stored OOBv2 invitation to target type. TODO should avoid using target of type `interface{}` [Issue #1030].
func (*Lookup) QueryConnectionRecords ¶
QueryConnectionRecords returns connection records found in underlying store for given query criteria.
type Record ¶
type Record struct { ConnectionID string State string ThreadID string ParentThreadID string TheirLabel string TheirDID string MyDID string ServiceEndPoint model.Endpoint // ServiceEndPoint is 'their' DIDComm service endpoint. RecipientKeys []string // RecipientKeys holds 'their' DIDComm recipient keys. RoutingKeys []string // RoutingKeys holds 'their' DIDComm routing keys. InvitationID string InvitationDID string InvitationRecipientKeys []string `json:"invitationRecipientKeys,omitempty"` // InvitationRecipientKeys holds keys generated for invitation Implicit bool Namespace string MediaTypeProfiles []string DIDCommVersion didcomm.Version PeerDIDInitialState string MyDIDRotation *DIDRotationRecord `json:"myDIDRotation,omitempty"` }
Record contain info about did exchange connection. nolint:lll
type Recorder ¶
type Recorder struct {
*Lookup
}
Recorder is read-write connection store.
func NewRecorder ¶
NewRecorder returns new connection recorder. Recorder is read-write connection store which provides write features on top query features from Lookup.
func (*Recorder) GetEvent ¶
GetEvent returns persisted event data for given connection ID. TODO connection event data shouldn't be transient [Issues #1029].
func (*Recorder) RemoveConnection ¶ added in v0.1.3
RemoveConnection removes connection record from the store for given id.
func (*Recorder) SaveConnectionRecord ¶
SaveConnectionRecord saves given connection records in underlying store.
func (*Recorder) SaveConnectionRecordWithMappings ¶
SaveConnectionRecordWithMappings saves newly created connection record against the connection id in the store and it creates mapping from namespaced ThreadID to connection ID.
func (*Recorder) SaveEvent ¶
SaveEvent saves event related data for given connection ID TODO connection event data shouldn't be transient [Issues #1029].
func (*Recorder) SaveInvitation ¶
SaveInvitation saves invitation in permanent store for given key. TODO should avoid using target of type `interface{}` [Issue #1030].
func (*Recorder) SaveNamespaceThreadID ¶
SaveNamespaceThreadID saves given namespace, threadID and connection ID mapping in protocol state store.
func (*Recorder) SaveOOBv2Invitation ¶ added in v0.1.8
SaveOOBv2Invitation saves OOBv2 invitation in permanent store under given ID. TODO should avoid using target of type `interface{}` [Issue #1030].