diff auth/persistent.go @ 190:3457a60fb12d

Added stub for a persistent session store.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 20 Jul 2018 17:11:57 +0200
parents
children 1585c334e8a7
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/auth/persistent.go	Fri Jul 20 17:11:57 2018 +0200
@@ -0,0 +1,49 @@
+package auth
+
+import (
+	"database/sql"
+	"log"
+)
+
+type PersistentConnectionPool struct {
+	filename string
+}
+
+func NewPersistentConnectionPool(filename string) (*PersistentConnectionPool, error) {
+
+	log.Println("NewInMemoryConnectionPool: Not implemented, yet.")
+	pcp := &PersistentConnectionPool{
+		filename: filename,
+	}
+	return pcp, nil
+}
+
+func (pcp *PersistentConnectionPool) Delete(token string) bool {
+	log.Println("Delete: Not implemented, yet.")
+	return false
+}
+
+func (pcp *PersistentConnectionPool) Add(token string, session *Session) *Connection {
+	log.Println("Add: Not implemented, yet.")
+	return nil
+}
+
+func (pcp *PersistentConnectionPool) Renew(token string) (string, error) {
+	log.Println("Renew: Not implemented, yet.")
+	return "", nil
+}
+
+func (pcp *PersistentConnectionPool) Do(token string, fn func(*sql.DB) error) error {
+	log.Println("Do: Not implemented, yet.")
+	return nil
+}
+
+func (pcp *PersistentConnectionPool) Session(token string) *Session {
+	log.Println("Session: Not implemented, yet.")
+	return nil
+}
+
+func (pcp *PersistentConnectionPool) Shutdown() error {
+	log.Println("Shutdown: Not implemented, yet.")
+	return nil
+}