protonmail: go fmt
This commit is contained in:
parent
d04c241914
commit
9ea16a03dd
|
@ -1,16 +1,16 @@
|
|||
package protonmail
|
||||
|
||||
type Attachment struct {
|
||||
ID string
|
||||
Name string
|
||||
Size int
|
||||
MIMEType string
|
||||
ID string
|
||||
Name string
|
||||
Size int
|
||||
MIMEType string
|
||||
KeyPackets string
|
||||
//Headers map[string]string
|
||||
}
|
||||
|
||||
type AttachmentKey struct {
|
||||
ID string
|
||||
Key string
|
||||
ID string
|
||||
Key string
|
||||
Algo string
|
||||
}
|
||||
|
|
|
@ -150,12 +150,12 @@ func entityPrimaryKey(e *openpgp.Entity) *openpgp.Key {
|
|||
}
|
||||
|
||||
type detachedSignatureReader struct {
|
||||
md *openpgp.MessageDetails
|
||||
body io.Reader
|
||||
signed bytes.Buffer
|
||||
md *openpgp.MessageDetails
|
||||
body io.Reader
|
||||
signed bytes.Buffer
|
||||
signature io.Reader
|
||||
keyring openpgp.KeyRing
|
||||
eof bool
|
||||
keyring openpgp.KeyRing
|
||||
eof bool
|
||||
}
|
||||
|
||||
func (r *detachedSignatureReader) Read(p []byte) (n int, err error) {
|
||||
|
@ -212,9 +212,9 @@ func (card *ContactCard) Read(keyring openpgp.KeyRing) (*openpgp.MessageDetails,
|
|||
|
||||
if card.Type.Signed() {
|
||||
r := &detachedSignatureReader{
|
||||
md: md,
|
||||
md: md,
|
||||
signature: strings.NewReader(card.Signature),
|
||||
keyring: keyring,
|
||||
keyring: keyring,
|
||||
}
|
||||
r.body = io.TeeReader(md.UnverifiedBody, &r.signed)
|
||||
|
||||
|
|
|
@ -17,35 +17,35 @@ type MessageEncryption int
|
|||
|
||||
type MessageAddress struct {
|
||||
Address string
|
||||
Name string
|
||||
Name string
|
||||
}
|
||||
|
||||
type Message struct {
|
||||
ID string
|
||||
Order int64
|
||||
Subject string
|
||||
IsRead int
|
||||
Type MessageType
|
||||
Sender *MessageAddress
|
||||
ReplyTo *MessageAddress
|
||||
ToList []*MessageAddress
|
||||
Time int64
|
||||
Size int64
|
||||
IsEncrypted MessageEncryption
|
||||
ID string
|
||||
Order int64
|
||||
Subject string
|
||||
IsRead int
|
||||
Type MessageType
|
||||
Sender *MessageAddress
|
||||
ReplyTo *MessageAddress
|
||||
ToList []*MessageAddress
|
||||
Time int64
|
||||
Size int64
|
||||
IsEncrypted MessageEncryption
|
||||
ExpirationTime int64
|
||||
IsReplied int
|
||||
IsRepliedAll int
|
||||
IsForwarded int
|
||||
SpamScore int
|
||||
AddressID string
|
||||
Body string
|
||||
MIMEType string
|
||||
CCList []*MessageAddress
|
||||
BCCList []*MessageAddress
|
||||
Header string
|
||||
Attachments []*Attachment
|
||||
LabelIDs []string
|
||||
ExternalID string
|
||||
IsReplied int
|
||||
IsRepliedAll int
|
||||
IsForwarded int
|
||||
SpamScore int
|
||||
AddressID string
|
||||
Body string
|
||||
MIMEType string
|
||||
CCList []*MessageAddress
|
||||
BCCList []*MessageAddress
|
||||
Header string
|
||||
Attachments []*Attachment
|
||||
LabelIDs []string
|
||||
ExternalID string
|
||||
}
|
||||
|
||||
func (c *Client) GetMessage(id string) (*Message, error) {
|
||||
|
@ -67,9 +67,9 @@ func (c *Client) GetMessage(id string) (*Message, error) {
|
|||
|
||||
func (c *Client) CreateDraftMessage(msg *Message, parentID string) (*Message, error) {
|
||||
reqData := struct {
|
||||
Message *Message
|
||||
Message *Message
|
||||
ParentID string `json:",omitempty"`
|
||||
Action *int `json:",omitempty"`
|
||||
Action *int `json:",omitempty"`
|
||||
}{msg, parentID, nil}
|
||||
req, err := c.newJSONRequest(http.MethodPost, "/messages", &reqData)
|
||||
if err != nil {
|
||||
|
@ -108,30 +108,30 @@ func (c *Client) UpdateDraftMessage(msg *Message) (*Message, error) {
|
|||
}
|
||||
|
||||
type MessageKeyPacket struct {
|
||||
ID string
|
||||
ID string
|
||||
KeyPackets string
|
||||
}
|
||||
|
||||
type MessagePackageType int
|
||||
|
||||
type MessagePackage struct {
|
||||
Address string
|
||||
Type MessagePackageType
|
||||
Body string
|
||||
Address string
|
||||
Type MessagePackageType
|
||||
Body string
|
||||
KeyPackets []*MessageKeyPacket
|
||||
|
||||
Token string
|
||||
EncToken string
|
||||
Token string
|
||||
EncToken string
|
||||
PasswordHint string `json:",omitempty"`
|
||||
}
|
||||
|
||||
type MessageOutgoing struct {
|
||||
ID string
|
||||
|
||||
ClearBody string
|
||||
ClearBody string
|
||||
ExpirationTime int64
|
||||
AttachmentKeys []*AttachmentKey
|
||||
Packages []*MessagePackage
|
||||
Packages []*MessagePackage
|
||||
}
|
||||
|
||||
func (c *Client) SendMessage(msg *MessageOutgoing) (sent, parent *Message, err error) {
|
||||
|
|
Loading…
Reference in New Issue