feat: implement base for surreal db

This commit is contained in:
Lakhan Samani
2022-11-24 19:08:17 +05:30
parent 70bab70ead
commit a366b2811d
10 changed files with 343 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package surrealdb
import (
"context"
"time"
"github.com/authorizerdev/authorizer/server/db/models"
"github.com/google/uuid"
)
// AddSession to save session information in database
func (p *provider) AddSession(ctx context.Context, session models.Session) error {
if session.ID == "" {
session.ID = uuid.New().String()
}
session.CreatedAt = time.Now().Unix()
session.UpdatedAt = time.Now().Unix()
return nil
}
// DeleteSession to delete session information from database
func (p *provider) DeleteSession(ctx context.Context, userId string) error {
return nil
}