Skip to content

Commit

Permalink
add dummy message
Browse files Browse the repository at this point in the history
  • Loading branch information
bistok diiel lelono committed Dec 11, 2020
1 parent 241056d commit 2d1a079
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions repository/lrucache_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import (
"fmt"
"os"
"sort"
"time"

lru "github.com/hashicorp/golang-lru"
"github.com/purwandi/mail"
"github.com/purwandi/mail/domain"
"github.com/segmentio/ksuid"
"go.uber.org/zap"
)

Expand Down Expand Up @@ -40,6 +42,44 @@ func NewLRUCacheStore(size int, logger *zap.Logger) (MessageRepository, error) {
if err != nil {
return nil, err
}
m1 := ksuid.New().String()
m2 := ksuid.New().String()
c.Add(m1, domain.Message{
ID: m1,
Subject: "7 Quotes by Albert Einstein That Will Change How You Think ",
Sender: "[email protected]",
From: []domain.Contact{
{Email: "[email protected]", Name: "Medium"},
},
To: []domain.Contact{
{Email: "[email protected]", Name: "Fooabar"},
},
TextBody: "We’ve almost made it to 2021. Have you built any particularly cool projects this year? We’d love to hear about them.",
HTMLBody: "<p>hello world</p>",
Attachments: []domain.Attachment{
{ID: "1lNigjr8fsntbweehfBLpkQRoMh", Filename: "attachment.txt", Filepath: "1lNigjr8fsntbweehfBLpkQRoMh.txt"},
{ID: "1lNip3BucJnkDGo2uAChhgib20T", Filename: "attachment.png", Filepath: "1lNip3BucJnkDGo2uAChhgib20T.png"},
},
Date: time.Now().Add(-20 * time.Minute),
})
c.Add(m2, domain.Message{
ID: m2,
Subject: "Change How You Think | Sinem Günel in Age of Awareness",
Sender: "[email protected]",
From: []domain.Contact{
{Email: "[email protected]", Name: "google"},
},
To: []domain.Contact{
{Email: "[email protected]", Name: "Foobar"},
},
TextBody: "Collaborating with multiple people can be difficult, especially with lots of back and forth across email and chat.",
HTMLBody: "<p>hello world</p>",
Attachments: []domain.Attachment{
{ID: "1lOs2EOqStjiMlDINR44KnMV9De", Filename: "attachment.txt", Filepath: "1lOs2EOqStjiMlDINR44KnMV9D.txt"},
{ID: "1lOs60waIw6LoEqWNPmL7LRR06M", Filename: "attachment.png", Filepath: "1lOs60waIw6LoEqWNPmL7LRR06M.png"},
},
Date: time.Now(),
})
return &lruCache{
cache: c,
}, nil
Expand Down

0 comments on commit 2d1a079

Please sign in to comment.