Documentation
¶
Index ¶
- Constants
- func CreateNamespaceKey(prefix, thID string) (string, error)
- 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) GetConnectionRecordByNSThreadID(nsThreadID string) (*Record, error)
- func (c *Lookup) GetInvitation(id 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
Constants ¶
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 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) GetConnectionRecordByNSThreadID ¶
GetConnectionRecordByNSThreadID return connection record via namespaced threadID
func (*Lookup) GetInvitation ¶
GetInvitation finds and parses stored 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 string RecipientKeys []string RoutingKeys []string InvitationID string InvitationDID string Implicit bool Namespace string }
Record contain info about did exchange connection
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 transient store