Add the beginnings of IMAP session management
This commit is contained in:
49
internal/imap/session.go
Normal file
49
internal/imap/session.go
Normal file
@@ -0,0 +1,49 @@
|
||||
package imap
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
imapbackend "github.com/emersion/go-imap/backend"
|
||||
)
|
||||
|
||||
var (
|
||||
notImplemented = fmt.Errorf("Not yet implemented")
|
||||
)
|
||||
|
||||
// type Session implements the User interface for emersion/go-imap
|
||||
type Session struct {
|
||||
ID uint64
|
||||
AccountName string
|
||||
ServiceName string
|
||||
}
|
||||
|
||||
func (s *Session) Username() string {
|
||||
return s.AccountName
|
||||
}
|
||||
|
||||
func (s *Session) ListMailboxes(subscribed bool) ([]imapbackend.Mailbox, error) {
|
||||
return nil, notImplemented
|
||||
}
|
||||
|
||||
func (s *Session) GetMailbox(name string) (imapbackend.Mailbox, error) {
|
||||
return nil, notImplemented
|
||||
}
|
||||
|
||||
func (s *Session) CreateMailbox(name string) error {
|
||||
return notImplemented
|
||||
}
|
||||
|
||||
func (s *Session) DeleteMailbox(name string) error {
|
||||
return notImplemented
|
||||
}
|
||||
|
||||
func (s *Session) RenameMailbox(existingName, newName string) error {
|
||||
return notImplemented
|
||||
}
|
||||
|
||||
func (s *Session) Logout() error {
|
||||
log.Printf("Ending %s session %d for %s", s.ServiceName, s.ID, s.AccountName)
|
||||
|
||||
return nil
|
||||
}
|
Reference in New Issue
Block a user