diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-01-09 20:39:00 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-01-09 20:39:00 -0500 |
commit | 6394e386c2a88c3b376cd422a7b7ce5ae7534984 (patch) | |
tree | 2d78f622096e439cf5d91a090999f5c522796c42 /worker/types | |
parent | 7d0edcc9e7ecdedb8cabafac1167581d7205596e (diff) | |
download | aerc-6394e386c2a88c3b376cd422a7b7ce5ae7534984.tar.gz |
Initial pass on worker/UI message passing
Diffstat (limited to 'worker/types')
-rw-r--r-- | worker/types/messages.go | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/worker/types/messages.go b/worker/types/messages.go new file mode 100644 index 0000000..845bb86 --- /dev/null +++ b/worker/types/messages.go @@ -0,0 +1,55 @@ +package types + +import ( + "git.sr.ht/~sircmpwn/aerc2/config" +) + +type WorkerMessage interface { + InResponseTo() WorkerMessage +} + +type Message struct { + inResponseTo WorkerMessage +} + +// Meta-messages +type Ack struct { + Message +} + +type Error struct { + Message + Error error +} + +type Unsupported struct { + Message +} + +// Commands +type Ping struct { + Message +} + +type Configure struct { + Message + Config config.AccountConfig +} + +type Connect struct { + Message +} + +type Disconnect struct { + Message +} + +func RespondTo(msg WorkerMessage) Message { + return Message{ + inResponseTo: msg, + } +} + +func (m Message) InResponseTo() WorkerMessage { + return m.inResponseTo +} |