diff options
Diffstat (limited to 'worker/jmap/cache/state.go')
-rw-r--r-- | worker/jmap/cache/state.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/worker/jmap/cache/state.go b/worker/jmap/cache/state.go new file mode 100644 index 00000000..5fec5034 --- /dev/null +++ b/worker/jmap/cache/state.go @@ -0,0 +1,30 @@ +package cache + +func (c *JMAPCache) GetMailboxState() (string, error) { + buf, err := c.get(mailboxStateKey) + if err != nil { + return "", err + } + return string(buf), nil +} + +func (c *JMAPCache) PutMailboxState(state string) error { + return c.put(mailboxStateKey, []byte(state)) +} + +func (c *JMAPCache) GetEmailState() (string, error) { + buf, err := c.get(emailStateKey) + if err != nil { + return "", err + } + return string(buf), nil +} + +func (c *JMAPCache) PutEmailState(state string) error { + return c.put(emailStateKey, []byte(state)) +} + +const ( + mailboxStateKey = "state/mailbox" + emailStateKey = "state/email" +) |