Skip to content

Commit

Permalink
Made DummyMailstore private according to alienscience#21.
Browse files Browse the repository at this point in the history
  • Loading branch information
EtienneBruines committed Jun 25, 2015
1 parent 1aa2168 commit 8e29f4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
3 changes: 0 additions & 3 deletions demo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ func main() {
//s.Start()

// More advanced config
m := &imap.DummyMailstore{}

s := imap.NewServer(
imap.Listen("127.0.0.1:1193"),
imap.Listen("127.0.0.1:1194"),
imap.Store(m),
)

err := s.Start()
Expand Down
14 changes: 7 additions & 7 deletions mailstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ type Mailstore interface {
}

// DummyMailstore is used for demonstrating the IMAP server
type DummyMailstore struct {
type dummyMailstore struct {
}

// GetMailbox gets mailbox information
func (m *DummyMailstore) GetMailbox(path []string) (*Mailbox, error) {
func (m *dummyMailstore) GetMailbox(path []string) (*Mailbox, error) {
return &Mailbox{
Name: "inbox",
Path: []string{"inbox"},
Expand All @@ -70,7 +70,7 @@ func (m *DummyMailstore) GetMailbox(path []string) (*Mailbox, error) {
}

// GetMailboxes gets a list of mailboxes at the given path
func (m *DummyMailstore) GetMailboxes(path []string) ([]*Mailbox, error) {
func (m *dummyMailstore) GetMailboxes(path []string) ([]*Mailbox, error) {
log.Printf("GetMailboxes %v", path)

if len(path) == 0 {
Expand Down Expand Up @@ -101,21 +101,21 @@ func (m *DummyMailstore) GetMailboxes(path []string) ([]*Mailbox, error) {
}

// FirstUnseen gets the sequence number of the first unseen message in an IMAP mailbox
func (m *DummyMailstore) FirstUnseen(mbox int64) (int64, error) {
func (m *dummyMailstore) FirstUnseen(mbox int64) (int64, error) {
return 4, nil
}

// TotalMessages gets the total number of messages in an IMAP mailbox
func (m *DummyMailstore) TotalMessages(mbox int64) (int64, error) {
func (m *dummyMailstore) TotalMessages(mbox int64) (int64, error) {
return 8, nil
}

// RecentMessages gets the total number of unread messages in an IMAP mailbox
func (m *DummyMailstore) RecentMessages(mbox int64) (int64, error) {
func (m *dummyMailstore) RecentMessages(mbox int64) (int64, error) {
return 4, nil
}

// DummyMailstore gets the next available uid in an IMAP mailbox
func (m *DummyMailstore) NextUid(mbox int64) (int64, error) {
func (m *dummyMailstore) NextUid(mbox int64) (int64, error) {
return 9, nil
}

0 comments on commit 8e29f4a

Please sign in to comment.