2018-01-10 02:39:00 +01:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
2018-02-01 03:54:52 +01:00
|
|
|
"crypto/x509"
|
|
|
|
|
2018-01-10 02:39:00 +01:00
|
|
|
"git.sr.ht/~sircmpwn/aerc2/config"
|
|
|
|
)
|
|
|
|
|
|
|
|
type WorkerMessage interface {
|
|
|
|
InResponseTo() WorkerMessage
|
|
|
|
}
|
|
|
|
|
|
|
|
type Message struct {
|
|
|
|
inResponseTo WorkerMessage
|
|
|
|
}
|
|
|
|
|
2018-02-01 03:54:52 +01:00
|
|
|
func RespondTo(msg WorkerMessage) Message {
|
|
|
|
return Message{
|
|
|
|
inResponseTo: msg,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m Message) InResponseTo() WorkerMessage {
|
|
|
|
return m.inResponseTo
|
|
|
|
}
|
|
|
|
|
2018-01-10 02:39:00 +01:00
|
|
|
// Meta-messages
|
2018-01-14 11:30:11 +01:00
|
|
|
|
2018-02-02 01:34:08 +01:00
|
|
|
type Done struct {
|
|
|
|
Message
|
|
|
|
}
|
|
|
|
|
2018-01-10 02:39:00 +01:00
|
|
|
type Error struct {
|
|
|
|
Message
|
|
|
|
Error error
|
|
|
|
}
|
|
|
|
|
|
|
|
type Unsupported struct {
|
|
|
|
Message
|
|
|
|
}
|
|
|
|
|
2018-02-01 03:54:52 +01:00
|
|
|
// Actions
|
2018-01-14 11:30:11 +01:00
|
|
|
|
2018-02-02 01:54:19 +01:00
|
|
|
type ApproveCertificate struct {
|
2018-01-10 02:39:00 +01:00
|
|
|
Message
|
2018-02-02 01:54:19 +01:00
|
|
|
Approved bool
|
2018-01-10 02:39:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type Configure struct {
|
|
|
|
Message
|
2018-01-11 15:04:18 +01:00
|
|
|
Config *config.AccountConfig
|
2018-01-10 02:39:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type Connect struct {
|
|
|
|
Message
|
|
|
|
}
|
|
|
|
|
|
|
|
type Disconnect struct {
|
|
|
|
Message
|
|
|
|
}
|
|
|
|
|
2018-02-02 01:34:08 +01:00
|
|
|
type ListDirectories struct {
|
|
|
|
Message
|
|
|
|
}
|
|
|
|
|
2018-02-01 03:54:52 +01:00
|
|
|
// Messages
|
2018-01-10 02:39:00 +01:00
|
|
|
|
2018-02-02 01:54:19 +01:00
|
|
|
type CertificateApprovalRequest struct {
|
2018-02-02 01:34:08 +01:00
|
|
|
Message
|
2018-02-02 01:54:19 +01:00
|
|
|
CertPool *x509.CertPool
|
2018-02-02 01:34:08 +01:00
|
|
|
}
|
|
|
|
|
2018-02-02 01:54:19 +01:00
|
|
|
type Directory struct {
|
2018-02-01 03:54:52 +01:00
|
|
|
Message
|
2018-02-02 01:54:19 +01:00
|
|
|
Attributes []string
|
|
|
|
Name string
|
2018-01-10 02:39:00 +01:00
|
|
|
}
|