This repository has been archived by the owner on May 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
listener.go
66 lines (51 loc) · 1.47 KB
/
listener.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package model
import "github.com/findy-network/findy-agent-vault/graph/model"
type Connection struct {
OurDID, TheirDID, TheirEndpoint, TheirLabel string
}
type Message struct {
Message string
SentByMe bool
}
type MessageUpdate struct {
Delivered bool
}
type Credential struct {
Role model.CredentialRole
SchemaID, CredDefID string
Attributes []*model.CredentialValue
InitiatedByUs bool
}
type CredentialUpdate struct {
ApprovedMs, IssuedMs, FailedMs *int64
}
type Proof struct {
Role model.ProofRole
Attributes []*model.ProofAttribute
InitiatedByUs bool
}
type ProofUpdate struct {
ApprovedMs, VerifiedMs, FailedMs *int64
}
type Listener interface {
AddConnection(job *JobInfo, connection *Connection) error
AddMessage(job *JobInfo, message *Message) error
UpdateMessage(job *JobInfo, update *MessageUpdate) error
AddCredential(job *JobInfo, credential *Credential) error
UpdateCredential(job *JobInfo, update *CredentialUpdate) error
AddProof(job *JobInfo, proof *Proof) error
UpdateProof(job *JobInfo, update *ProofUpdate) error
FailJob(job *JobInfo) error
}
type ArchiveInfo struct {
AgentID string
JobID string
ConnectionID string
InitiatedByUs bool
}
type Archiver interface {
ArchiveConnection(info *ArchiveInfo, connection *Connection)
ArchiveMessage(info *ArchiveInfo, message *Message)
ArchiveCredential(info *ArchiveInfo, credential *Credential)
ArchiveProof(info *ArchiveInfo, proof *Proof)
}