feat/add arangodb support (#80)

*feat: add arangodb init

* fix: dao for sql + arangodb

* fix: update error logs

* fix: use db name dynamically
This commit is contained in:
Lakhan Samani
2021-12-17 21:25:07 +05:30
committed by GitHub
parent 155d2e65c2
commit f110255310
33 changed files with 640 additions and 266 deletions

View File

@@ -29,7 +29,7 @@ func (c *RedisStore) DeleteUserSession(userId string) {
}
}
func (c *RedisStore) DeleteToken(userId, accessToken string) {
func (c *RedisStore) DeleteVerificationRequest(userId, accessToken string) {
err := c.store.HDel(c.ctx, "authorizer_"+userId, accessToken).Err()
if err != nil {
log.Fatalln("Error deleting redis token:", err)
@@ -47,7 +47,7 @@ func (c *RedisStore) GetToken(userId, accessToken string) string {
token := ""
res, err := c.store.HMGet(c.ctx, "authorizer_"+userId, accessToken).Result()
if err != nil {
log.Println("Error getting token from redis store:", err)
log.Println("error getting token from redis store:", err)
}
if len(res) > 0 && res[0] != nil {
token = fmt.Sprintf("%v", res[0])
@@ -66,7 +66,7 @@ func (c *RedisStore) GetSocialLoginState(key string) string {
state := ""
state, err := c.store.Get(c.ctx, key).Result()
if err != nil {
log.Println("Error getting token from redis store:", err)
log.Println("error getting token from redis store:", err)
}
return state