Debian Codegraph @

worker/jmap/cache/state.go

raw
1 package cache
2
3 func (c *JMAPCache) GetMailboxState() (string, error) {
4 buf, err := c.get(mailboxStateKey)
5 if err != nil {
6 return "", err
7 }
8 return string(buf), nil
9 }
10
11 func (c *JMAPCache) PutMailboxState(state string) error {
12 return c.put(mailboxStateKey, []byte(state))
13 }
14
15 func (c *JMAPCache) GetEmailState() (string, error) {
16 buf, err := c.get(emailStateKey)
17 if err != nil {
18 return "", err
19 }
20 return string(buf), nil
21 }
22
23 func (c *JMAPCache) PutEmailState(state string) error {
24 return c.put(emailStateKey, []byte(state))
25 }
26
27 func (c *JMAPCache) GetThreadState() (string, error) {
28 buf, err := c.get(threadStateKey)
29 if err != nil {
30 return "", err
31 }
32 return string(buf), nil
33 }
34
35 func (c *JMAPCache) PutThreadState(state string) error {
36 return c.put(threadStateKey, []byte(state))
37 }
38
39 const (
40 mailboxStateKey = "state/mailbox"
41 emailStateKey = "state/email"
42 threadStateKey = "state/thread"
43 )