aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2019-12-03 11:12:26 +0100
committerSimon Ser <contact@emersion.fr>2019-12-03 11:12:26 +0100
commit4cbe2fde9dad377dfedbf57b5e77df78e4e5b417 (patch)
treef01a9e0575fc328654776a97f18761056c1e93e7 /server.go
parent61f2f3e139dbc39618a9764a5b80af61933167da (diff)
downloadalps-4cbe2fde9dad377dfedbf57b5e77df78e4e5b417.tar.gz
alps-4cbe2fde9dad377dfedbf57b5e77df78e4e5b417.zip
go fmt
Diffstat (limited to 'server.go')
-rw-r--r--server.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/server.go b/server.go
index 86a1963..b252076 100644
--- a/server.go
+++ b/server.go
@@ -8,16 +8,16 @@ import (
"strings"
"time"
- "github.com/labstack/echo/v4"
imapclient "github.com/emersion/go-imap/client"
+ "github.com/labstack/echo/v4"
)
const cookieName = "koushin_session"
type Server struct {
imap struct {
- host string
- tls bool
+ host string
+ tls bool
insecure bool
pool *ConnPool
@@ -51,15 +51,15 @@ func NewServer(imapURL string) (*Server, error) {
type context struct {
echo.Context
server *Server
- conn *imapclient.Client
+ conn *imapclient.Client
}
var aLongTimeAgo = time.Unix(233431200, 0)
func (c *context) setToken(token string) {
cookie := http.Cookie{
- Name: cookieName,
- Value: token,
+ Name: cookieName,
+ Value: token,
HttpOnly: true,
// TODO: domain, secure
}
@@ -179,9 +179,9 @@ func New(imapURL string) *echo.Echo {
}
return ctx.Render(http.StatusOK, "mailbox.html", map[string]interface{}{
- "Mailbox": ctx.conn.Mailbox(),
+ "Mailbox": ctx.conn.Mailbox(),
"Mailboxes": mailboxes,
- "Messages": msgs,
+ "Messages": msgs,
})
})
@@ -206,7 +206,7 @@ func New(imapURL string) *echo.Echo {
return ctx.Render(http.StatusOK, "message.html", map[string]interface{}{
"Mailbox": ctx.conn.Mailbox(),
"Message": msg,
- "Body": body,
+ "Body": body,
})
})