Files
crockery/internal/imap/session.go

52 lines
1014 B
Go

package imap
import (
"fmt"
"log"
imapbackend "github.com/emersion/go-imap/backend"
"ur.gs/crockery/internal/store"
)
var (
notImplemented = fmt.Errorf("Not yet implemented")
)
// type Session implements the User interface for emersion/go-imap
type Session struct {
ID uint64
Account *store.Account
ServiceName string
}
func (s *Session) Username() string {
return s.Account.Username
}
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.Username())
return nil
}