diff options
author | 2019-12-09 18:16:27 +0100 | |
---|---|---|
committer | 2019-12-09 18:16:31 +0100 | |
commit | efd401bfbf62b2216fe92b4d8be8c07e77b78482 (patch) | |
tree | 7eba39da086f891d564ce04ae0b43457e4f6edce /server.go | |
parent | 800a83059d95abb56cdd28049aeeaeb1f16699da (diff) | |
download | alps-efd401bfbf62b2216fe92b4d8be8c07e77b78482.tar.gz alps-efd401bfbf62b2216fe92b4d8be8c07e77b78482.tar.bz2 alps-efd401bfbf62b2216fe92b4d8be8c07e77b78482.zip |
Rename ConnPool to SessionManager
Diffstat (limited to 'server.go')
-rw-r--r-- | server.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -15,12 +15,12 @@ const cookieName = "koushin_session" const messagesPerPage = 50 type Server struct { + sessions *SessionManager + imap struct { host string tls bool insecure bool - - pool *ConnPool } smtp struct { @@ -76,11 +76,11 @@ func (s *Server) parseSMTPURL(smtpURL string) error { func newServer(imapURL, smtpURL string) (*Server, error) { s := &Server{} + s.sessions = NewSessionManager() if err := s.parseIMAPURL(imapURL); err != nil { return nil, err } - s.imap.pool = NewConnPool() if smtpURL != "" { if err := s.parseSMTPURL(smtpURL); err != nil { @@ -166,7 +166,7 @@ func New(e *echo.Echo, options *Options) error { return err } - ctx.session, err = ctx.server.imap.pool.Get(cookie.Value) + ctx.session, err = ctx.server.sessions.Get(cookie.Value) if err == ErrSessionExpired { ctx.setToken("") return ctx.Redirect(http.StatusFound, "/login") |