aboutsummaryrefslogtreecommitdiff
path: root/internal/imap/cmds.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-23 20:48:17 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-23 20:48:17 +0200
commitc883470c2ef977b8675b12428591bb003694e235 (patch)
tree09cd8fa950594e1ea13aa52492ce8116e07ef30b /internal/imap/cmds.go
parent6bd87a567ef481b922f6baec2b475ec376c45443 (diff)
downloadfeed2imap-go-c883470c2ef977b8675b12428591bb003694e235.tar.gz
feed2imap-go-c883470c2ef977b8675b12428591bb003694e235.tar.bz2
feed2imap-go-c883470c2ef977b8675b12428591bb003694e235.zip
Restructure imap pkg
Diffstat (limited to '')
-rw-r--r--internal/imap/cmds.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/imap/cmds.go b/internal/imap/cmds.go
new file mode 100644
index 0000000..499d6c0
--- /dev/null
+++ b/internal/imap/cmds.go
@@ -0,0 +1,27 @@
+package imap
+
+type ensureCommando struct {
+ folder Folder
+}
+
+func (cmd ensureCommando) execute(conn *connection) error {
+ return conn.ensureFolder(cmd.folder)
+}
+
+func (client *Client) EnsureFolder(folder Folder) error {
+ return client.commander.execute(ensureCommando{folder})
+}
+
+
+type addCommando struct {
+ folder Folder
+ messages []string
+}
+
+func (cmd addCommando) execute(conn *connection) error {
+ return conn.putMessages(cmd.folder, cmd.messages)
+}
+
+func (client *Client) PutMessages(folder Folder, messages []string) error {
+ return client.commander.execute(addCommando{folder, messages})
+}