diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-23 20:48:17 +0200 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2020-04-23 20:48:17 +0200 |
commit | c883470c2ef977b8675b12428591bb003694e235 (patch) | |
tree | 09cd8fa950594e1ea13aa52492ce8116e07ef30b /internal/imap/cmds.go | |
parent | 6bd87a567ef481b922f6baec2b475ec376c45443 (diff) | |
download | feed2imap-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.go | 27 |
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}) +} |