diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-01-31 21:54:52 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-01-31 21:54:52 -0500 |
commit | 3139148c7b9ad6ed4fb9cd8cd3e4160a9b9ee46f (patch) | |
tree | 1bb500628bae5f6b64167e498b25ff09649a977c /worker/types | |
parent | a21afdaa6bab8f6d05bbe9272700eef571548a59 (diff) | |
download | aerc-3139148c7b9ad6ed4fb9cd8cd3e4160a9b9ee46f.tar.gz |
Add certificate approval flow
Diffstat (limited to 'worker/types')
-rw-r--r-- | worker/types/messages.go | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/worker/types/messages.go b/worker/types/messages.go index e83bd6b..5259342 100644 --- a/worker/types/messages.go +++ b/worker/types/messages.go @@ -1,6 +1,8 @@ package types import ( + "crypto/x509" + "git.sr.ht/~sircmpwn/aerc2/config" ) @@ -12,6 +14,16 @@ type Message struct { inResponseTo WorkerMessage } +func RespondTo(msg WorkerMessage) Message { + return Message{ + inResponseTo: msg, + } +} + +func (m Message) InResponseTo() WorkerMessage { + return m.inResponseTo +} + // Meta-messages type Ack struct { @@ -27,7 +39,7 @@ type Unsupported struct { Message } -// Commands +// Actions type Ping struct { Message @@ -46,12 +58,10 @@ type Disconnect struct { Message } -func RespondTo(msg WorkerMessage) Message { - return Message{ - inResponseTo: msg, - } -} +// Messages -func (m Message) InResponseTo() WorkerMessage { - return m.inResponseTo +// Respond with an Ack to approve or Disconnect to reject +type ApproveCertificate struct { + Message + CertPool *x509.CertPool } |